.vcHbot {
  --vc-hbot-primary: #0b4f9f;
  --vc-hbot-primary-strong: #083b76;
  --vc-hbot-accent: #24a7e8;
  --vc-hbot-ink: #10233c;
  --vc-hbot-muted: #63748b;
  --vc-hbot-border: rgba(16, 35, 60, 0.12);
  --vc-hbot-surface: #ffffff;
  --vc-hbot-shell: #f3f7fc;
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1200;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.vcHbotPanel {
  width: min(390px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin-bottom: 14px;
  border: 1px solid rgba(11, 79, 159, 0.12);
  border-radius: 28px;
  background: var(--vc-hbot-surface);
  box-shadow: 0 28px 60px rgba(11, 31, 64, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vcHbotHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  color: #fff;
  background: linear-gradient(135deg, #0a4b97 0%, #1273bf 52%, #2caee8 100%);
}

.vcHbotHeadMain {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.vcHbotAvatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.vcHbotAvatarImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vcHbotAvatar--bot,
.vcHbotLauncherIcon--bot {
  padding: 0;
}

.vcHbotHeadText {
  min-width: 0;
}

.vcHbotHeadTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.vcHbotHeadMeta {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  line-height: 1.45;
}

.vcHbotClose,
.vcHbotTool,
.vcHbotReplyClear,
.vcHbotMessageReplyBtn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.vcHbotClose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  flex: 0 0 auto;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.vcHbotClose svg,
.vcHbotTool svg,
.vcHbotReplyClear svg,
.vcHbotSend svg,
.vcHbotMessageReplyBtn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vcHbotBody {
  background: var(--vc-hbot-shell);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.vcHbotMessages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 190px;
  padding: 18px 16px 8px;
  overflow-y: auto;
}

.vcHbotEmpty {
  padding: 22px 18px;
  border: 1px dashed rgba(11, 79, 159, 0.18);
  border-radius: 22px;
  color: var(--vc-hbot-muted);
  font-size: 14px;
  line-height: 1.7;
  background: #fff;
}

.vcHbotMessageRow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vcHbotMessageRow.is-user {
  align-items: flex-end;
}

.vcHbotMessageRow.is-bot,
.vcHbotMessageRow.is-admin {
  align-items: flex-start;
}

.vcHbotBubble {
  position: relative;
  width: fit-content;
  max-width: min(84%, 300px);
  padding: 13px 14px 12px;
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(11, 31, 64, 0.08);
}

.vcHbotBubble.is-user {
  color: #fff;
  border-bottom-right-radius: 8px;
  background: #0d61bc;
}

.vcHbotBubble.is-user .vcHbotBubbleLabel,
.vcHbotBubble.is-user .vcHbotBubbleText,
.vcHbotBubble.is-user .vcHbotBubbleTime,
.vcHbotBubble.is-user .vcHbotMessageReplyBtn {
  color: #fff;
}

.vcHbotBubble.is-user .vcHbotBubbleTime {
  opacity: 0.88;
}

.vcHbotBubble.is-user .vcHbotMessageReplyBtn {
  opacity: 0.92;
}

.vcHbotBubble.is-user .vcHbotMessageReplyBtn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.vcHbotBubble.is-bot {
  color: var(--vc-hbot-ink);
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(16, 35, 60, 0.08);
  background: #fff;
}

.vcHbotBubble.is-admin {
  color: #0d2f58;
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(36, 167, 232, 0.22);
  background: #e9f6ff;
}

.vcHbotBubbleHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.vcHbotBubbleLabel {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.84;
}

.vcHbotMessageReplyBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: inherit;
  opacity: 0.68;
}

.vcHbotMessageReplyBtn:hover {
  opacity: 1;
  background: rgba(16, 35, 60, 0.08);
}

.vcHbotBubbleReply {
  margin-bottom: 9px;
  padding: 9px 10px;
  border-radius: 14px;
  border-left: 3px solid rgba(36, 167, 232, 0.9);
  background: rgba(255, 255, 255, 0.58);
}

.vcHbotBubble.is-user .vcHbotBubbleReply {
  border-left-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.14);
}

.vcHbotBubbleReplyLabel {
  display: block;
  color: var(--vc-hbot-primary-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vcHbotBubbleReplyText {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: inherit;
  opacity: 0.86;
}

.vcHbotBubble.is-user .vcHbotBubbleReplyLabel,
.vcHbotBubble.is-user .vcHbotBubbleReplyText {
  color: #fff;
  opacity: 1;
}

.vcHbotBubbleText {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.7;
}

.vcHbotBubbleAttachments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.vcHbotAttachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.68);
}

.vcHbotAttachmentThumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(11, 79, 159, 0.1);
}

.vcHbotAttachmentThumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vcHbotAttachmentIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: 0 0 auto;
  color: var(--vc-hbot-primary-strong);
  background: rgba(11, 79, 159, 0.12);
}

.vcHbotAttachmentIcon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.vcHbotAttachmentMeta {
  min-width: 0;
}

.vcHbotAttachmentName {
  display: block;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.vcHbotAttachmentSize {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.75;
}

.vcHbotBubbleTime {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.7;
}

.vcHbotComposer {
  flex: 0 0 auto;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(11, 79, 159, 0.08);
  background: #fff;
}

.vcHbotReplyBar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #eef6ff;
  border: 1px solid rgba(11, 79, 159, 0.12);
}

.vcHbotReplyCopy {
  min-width: 0;
}

.vcHbotReplyLabel {
  display: block;
  color: var(--vc-hbot-primary-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vcHbotReplyText {
  display: block;
  margin-top: 2px;
  color: var(--vc-hbot-ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vcHbotReplyClear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: var(--vc-hbot-muted);
}

.vcHbotAttachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.vcHbotAttachmentChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f2f6fb;
  border: 1px solid rgba(16, 35, 60, 0.1);
}

.vcHbotAttachmentChipName {
  max-width: 200px;
  color: var(--vc-hbot-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vcHbotAttachmentChipRemove {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--vc-hbot-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.vcHbotInputShell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "input input"
    "tools send";
  gap: 10px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(16, 35, 60, 0.12);
  border-radius: 24px;
  background: #fff;
}

.vcHbotTools {
  grid-area: tools;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.vcHbotTool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: var(--vc-hbot-primary-strong);
}

.vcHbotTool:hover,
.vcHbotTool.is-active {
  background: rgba(11, 79, 159, 0.08);
}

.vcHbotInput {
  grid-area: input;
  width: 100%;
  min-height: 54px;
  max-height: 132px;
  padding: 4px 8px 2px 8px;
  margin: 0;
  border: 0;
  resize: none;
  outline: none;
  color: var(--vc-hbot-ink);
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
}

.vcHbotInput::placeholder {
  color: #8795a8;
}

.vcHbotSend {
  grid-area: send;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0a4b97 0%, #1a86d7 100%);
  box-shadow: 0 14px 28px rgba(10, 75, 151, 0.2);
}

.vcHbotSend:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.vcHbotEmojiPicker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 20px;
  background: #f8fbff;
  border: 1px solid rgba(16, 35, 60, 0.08);
}

.vcHbotEmojiBtn {
  border: 0;
  border-radius: 12px;
  padding: 8px 0;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.vcHbotState {
  margin-top: 10px;
  color: var(--vc-hbot-primary-strong);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.vcHbotFootnote {
  margin: 8px 0 0;
  color: var(--vc-hbot-muted);
  font-size: 12px;
  line-height: 1.55;
}

.vcHbotLauncher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 18px 10px 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0a4b97 0%, #1069bc 48%, #1fa8e6 100%);
  box-shadow: 0 20px 40px rgba(32, 52, 110, 0.28);
}

.vcHbotLauncherIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 19px;
  font-weight: 700;
}

.vcHbotLauncherText {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.vcHbotLauncherMeta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.vcHbotLauncherTitle {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.vcHbotLauncherPing {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5a6b;
  box-shadow: 0 0 0 5px rgba(255, 90, 107, 0.16);
}

@media (max-width: 767px) {
  .vcHbot {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .vcHbotPanel {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .vcHbotMessages {
    min-height: 160px;
  }

  .vcHbotLauncher {
    width: auto;
    max-width: 100%;
  }
}
