.vc-chat {
  --vc-chat-ink: #050607;
  --vc-chat-blue: #476f84;
  --vc-chat-blue-dark: #294e61;
  --vc-chat-pale: #eef3f5;
  --vc-chat-line: #d8dfe2;
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 999;
  color: var(--vc-chat-ink);
  font-family: var(--vc-body, Inter, ui-sans-serif, system-ui, sans-serif);
}

.vc-chat button,
.vc-chat textarea {
  font: inherit;
}

.vc-chat__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 46px;
  margin: 0;
  padding: 0;
  border: 1px solid #050607;
  border-radius: 999px;
  background: #050607;
  color: #fff;
  box-shadow: 0 12px 32px rgb(5 6 7 / 22%);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  line-height: 1;
}

.vc-chat__toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.vc-chat__toggle:hover,
.vc-chat__toggle:focus-visible {
  border-color: var(--vc-chat-blue-dark);
  background: var(--vc-chat-blue-dark);
  color: #fff;
}

.vc-chat__toggle svg {
  width: 19px;
  height: 19px;
}

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

.vc-chat__panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(430px, calc(100vw - 32px));
  height: min(610px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid rgb(5 6 7 / 14%);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(5 6 7 / 24%);
}

.vc-chat__header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--vc-chat-line);
  background: #f7f9fa;
}

.vc-chat__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--vc-chat-line);
  border-radius: 8px;
  background: #fff;
  color: var(--vc-chat-blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.vc-chat__mark img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.vc-chat__heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vc-chat__heading strong {
  color: var(--vc-chat-ink);
  font-family: var(--vc-product-title, "Bricolage Grotesque", sans-serif);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.2;
}

.vc-chat__heading span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgb(5 6 7 / 60%);
  font-size: 12px;
  line-height: 1.2;
}

.vc-chat__heading i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d8b61;
  box-shadow: 0 0 0 3px rgb(45 139 97 / 12%);
}

.vc-chat__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--vc-chat-ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.vc-chat__close:hover,
.vc-chat__close:focus-visible {
  background: rgb(5 6 7 / 7%);
  color: var(--vc-chat-ink);
}

.vc-chat__body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 13px;
  min-height: 0;
  padding: 15px;
  background: #fff;
}

.vc-chat__quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.vc-chat__quick button {
  min-height: 38px;
  margin: 0;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--vc-chat-pale);
  color: var(--vc-chat-ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
}

.vc-chat__quick button:hover,
.vc-chat__quick button:focus-visible {
  border-color: #c6d3d8;
  background: #e3ebee;
  color: var(--vc-chat-ink);
}

.vc-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 5px 6px 1px;
  scrollbar-color: #b8c4c9 transparent;
  scrollbar-width: thin;
}

.vc-chat__message {
  width: fit-content;
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--vc-chat-ink);
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.vc-chat__message--bot {
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  background: var(--vc-chat-pale);
}

.vc-chat__message--loading {
  color: rgb(5 6 7 / 58%);
}

.vc-chat__message--user {
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  background: var(--vc-chat-blue-dark);
  color: #fff;
}

.vc-chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--vc-chat-line);
}

.vc-chat__form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: 96px;
  margin: 0;
  padding: 11px 12px;
  resize: none;
  border: 1px solid #b9c5ca;
  border-radius: 8px;
  background: #fff;
  color: var(--vc-chat-ink);
  font-size: 14px;
  line-height: 1.4;
}

.vc-chat__form textarea:focus {
  border-color: var(--vc-chat-blue);
  outline: 2px solid rgb(71 111 132 / 15%);
  outline-offset: 0;
}

.vc-chat__form button {
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--vc-chat-ink);
  border-radius: 8px;
  background: var(--vc-chat-ink);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.vc-chat__form button:hover,
.vc-chat__form button:focus-visible {
  border-color: var(--vc-chat-blue-dark);
  background: var(--vc-chat-blue-dark);
  color: #fff;
}

.vc-chat button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.vc-chat__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgb(5 6 7 / 53%);
  font-size: 11px;
  line-height: 1.25;
}

.vc-chat__footer div {
  display: flex;
  gap: 12px;
}

.vc-chat__footer a {
  color: var(--vc-chat-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.vc-chat__footer a:hover,
.vc-chat__footer a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .vc-chat {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .vc-chat__panel {
    position: fixed;
    right: 10px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    height: min(620px, calc(100dvh - 86px));
    border-radius: 12px;
  }

  .vc-chat__header {
    min-height: 64px;
    padding: 10px 12px;
  }

  .vc-chat__body {
    gap: 10px;
    padding: 11px;
  }

  .vc-chat__quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vc-chat__quick button {
    min-height: 34px;
  }

  .vc-chat__message {
    max-width: 91%;
  }

  .vc-chat__footer > span {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .vc-chat__panel {
    transform-origin: bottom right;
    animation: vc-chat-open 150ms ease-out;
  }

  @keyframes vc-chat-open {
    from {
      transform: translateY(7px) scale(0.988);
      opacity: 0;
    }

    to {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
  }
}
