.vc-ai-chat {
  --vc-blue: #0445af;
  --vc-gold: #ffc532;
  --vc-cyan: #04b8d8;
  --vc-ink: #12233a;
  --vc-red: #ee1515;
  --vc-red-dark: #b80f12;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 99999;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--vc-ink);
}

.vc-ai-chat__toggle {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(145deg, var(--vc-blue), #033894);
  color: #fff;
  box-shadow: 0 8px 24px rgba(4, 69, 175, 0.35);
  font-size: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
}

.vc-ai-chat__toggle--oak,
.vc-ai-chat__toggle--avatar {
  box-sizing: border-box;
  background: #f4f6f8;
  color: transparent;
  font-size: 0;
}

.vc-ai-chat__toggle--oak {
  border: 2px solid #ee1515;
  box-shadow: 0 4px 14px rgba(238, 21, 21, 0.22);
}

.vc-ai-chat__toggle--avatar {
  border: 2px solid var(--vc-blue);
  box-shadow: 0 4px 14px rgba(4, 69, 175, 0.28);
}

.vc-ai-chat__toggle--avatar .vc-ai-chat__toggle-img {
  object-position: center 40%;
}

.vc-ai-chat__toggle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  pointer-events: none;
}

.vc-ai-chat__toggle:focus-visible {
  outline: 3px solid var(--vc-gold);
  outline-offset: 2px;
}

.vc-ai-chat__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(360px, calc(100vw - 24px));
  height: min(480px, calc(100dvh - 100px));
  background: #fff;
  border: 1px solid #f3c5c8;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(184, 15, 18, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.vc-ai-chat__head {
  background: linear-gradient(135deg, #8e0c10, var(--vc-red) 55%, #ff3344);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vc-ai-chat__head strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.vc-ai-chat__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  min-width: 32px;
  min-height: 32px;
}

.vc-ai-chat__msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #fff7f7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vc-ai-chat__bubble {
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.vc-ai-chat__bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #f3c5c8;
  white-space: normal;
}

.vc-ai-chat__bubble--user {
  align-self: flex-end;
  background: var(--vc-red);
  color: #fff;
}

.vc-ai-chat__link {
  color: var(--vc-red-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.vc-ai-chat__link:hover,
.vc-ai-chat__link:focus-visible {
  color: var(--vc-red);
}

.vc-ai-chat__bubble--busy {
  opacity: 0.75;
  font-style: italic;
}

.vc-ai-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #f3c5c8;
  background: #fff;
}

.vc-ai-chat__form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e8b4b7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}

.vc-ai-chat__form button {
  border: 0;
  border-radius: 10px;
  background: var(--vc-gold);
  color: #12233a;
  font-weight: 700;
  padding: 0 14px;
  min-height: 44px;
  cursor: pointer;
}

.vc-ai-chat__form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (min-width: 783px) {
  .vc-ai-chat__toggle--oak,
  .vc-ai-chat__toggle--avatar {
    width: 112px;
    height: 112px;
    border-width: 3px;
  }

  .vc-ai-chat__toggle--oak {
    box-shadow: 0 8px 22px rgba(238, 21, 21, 0.28);
  }

  .vc-ai-chat__toggle--avatar {
    box-shadow: 0 8px 22px rgba(4, 69, 175, 0.32);
  }

  .vc-ai-chat__panel {
    bottom: 128px;
  }
}
