.vcai-chat-root {
  --vcai-color: #166534;
  --vcai-width: 380px;
  --vcai-height: 560px;
  --vcai-launcher-button-size: 96px;
  --vcai-launcher-icon-size: 84px;
  --vcai-launcher-mobile-button-size: 88px;
  --vcai-launcher-mobile-icon-size: 76px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  color: #111827;
  font-family: inherit;
}

.vcai-chat-root[data-position="bottom_left"] {
  right: auto;
  left: 20px;
}

.vcai-launcher {
  min-width: var(--vcai-launcher-button-size, 96px);
  width: var(--vcai-launcher-button-size, 96px);
  height: var(--vcai-launcher-button-size, 96px);
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--vcai-color);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .24);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  will-change: transform;
}

.vcai-launcher[data-shape="pill"] {
  width: auto;
  min-width: var(--vcai-launcher-button-size, 96px);
  padding: 0 16px;
  border-radius: 999px;
  aspect-ratio: auto;
}

.vcai-launcher[data-shape="circle"] {
  width: var(--vcai-launcher-button-size, 96px);
  min-width: var(--vcai-launcher-button-size, 96px);
  padding: 0;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.vcai-launcher.vcai-launcher-has-custom-icon {
  background: transparent;
}

.vcai-launcher.vcai-launcher-has-custom-icon[data-has-text="false"] {
  width: var(--vcai-launcher-button-size, 96px);
  min-width: var(--vcai-launcher-button-size, 96px);
  height: var(--vcai-launcher-button-size, 96px);
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 50%;
}

.vcai-launcher-icon-wrap {
  width: var(--vcai-launcher-icon-size, 84px);
  height: var(--vcai-launcher-icon-size, 84px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: 0 0 auto;
  background: transparent;
  transition: transform 180ms ease, filter 180ms ease;
  will-change: transform;
}

.vcai-launcher-icon {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: transparent;
}

.vcai-launcher-text {
  white-space: nowrap;
  line-height: 1;
}

.vcai-launcher:not([data-animation="disabled"]):hover,
.vcai-launcher:not([data-animation="disabled"]):focus-visible {
  transform: scale(1.08);
}

.vcai-launcher:not([data-animation="disabled"]):hover .vcai-launcher-icon-wrap,
.vcai-launcher:not([data-animation="disabled"]):focus-visible .vcai-launcher-icon-wrap {
  transform: scale(1.16);
}

.vcai-launcher.vcai-launcher-pressed:not([data-animation="disabled"]) {
  transform: scale(1.12);
  filter: brightness(0.94);
}

.vcai-launcher.vcai-launcher-pressed:not([data-animation="disabled"]) .vcai-launcher-icon-wrap {
  transform: scale(1.28);
}

.vcai-launcher.vcai-launcher-opening:not([data-animation="disabled"]) .vcai-launcher-icon-wrap {
  animation: vcaiLauncherPop 280ms ease-out;
}

@keyframes vcaiLauncherPop {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

.vcai-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(var(--vcai-width), calc(100vw - 32px));
  height: min(var(--vcai-height), calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
}

.vcai-chat-root[data-position="bottom_left"] .vcai-panel {
  right: auto;
  left: 0;
}

.vcai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  background: var(--vcai-color);
  color: #fff;
}

.vcai-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vcai-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.vcai-icon-btn,
.vcai-send {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.vcai-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 18px;
}

.vcai-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
}

.vcai-message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.vcai-message-user {
  margin-left: auto;
  background: var(--vcai-color);
  color: #fff;
}

.vcai-message-assistant {
  margin-right: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.vcai-message-system {
  max-width: 100%;
  margin-inline: auto;
  background: #fff7ed;
  color: #7c2d12;
  border: 1px solid #fed7aa;
}

.vcai-message-system.vcai-processing {
  color: #374151;
  background: #f9fafb;
  border-color: #e5e7eb;
  font-style: italic;
}

.vcai-message a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vcai-product-cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.vcai-product-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  text-decoration: none;
}

.vcai-product-card:hover,
.vcai-product-card:focus-visible {
  border-color: var(--vcai-color);
}

.vcai-product-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  background: #f8fafc;
}

.vcai-product-body {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.vcai-product-name {
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
}

.vcai-product-meta {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}

.vcai-product-price {
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
}

.vcai-product-cart,
.vcai-product-more {
  color: var(--vcai-color);
  font-size: 12px;
  font-weight: 700;
}

.vcai-product-cart {
  color: #475569;
  font-weight: 600;
}

.vcai-product-more {
  justify-self: start;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vcai-form {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.vcai-form.has-audio {
  grid-template-columns: 1fr auto 44px;
}

.vcai-input {
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 11px;
  color: #111827;
}

.vcai-send {
  width: 44px;
  height: 42px;
  border-radius: 6px;
  background: var(--vcai-color);
  color: #fff;
}

.vcai-audio {
  min-width: 44px;
  height: 42px;
  border-radius: 6px;
  background: #eef2ff;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
}

.vcai-audio.is-recording {
  background: #fee2e2;
  color: #991b1b;
}

.vcai-icon-btn:focus-visible,
.vcai-launcher:focus-visible,
.vcai-input:focus-visible,
.vcai-audio:focus-visible,
.vcai-send:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.vcai-chat-root.vcai-fullscreen {
  inset: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .46);
}

.vcai-chat-root.vcai-fullscreen .vcai-launcher {
  display: none;
}

.vcai-chat-root.vcai-fullscreen .vcai-panel {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  width: min(1100px, calc(100vw - 48px));
  height: min(860px, calc(100dvh - 48px));
  border-radius: 8px;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.vcai-chat-root.vcai-fullscreen .vcai-header,
.vcai-chat-root.vcai-fullscreen .vcai-form {
  margin-inline: auto;
  width: 100%;
}

.vcai-chat-root.vcai-fullscreen .vcai-messages {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding: 24px max(24px, calc((100% - 960px) / 2));
  overscroll-behavior: contain;
}

.vcai-chat-root.vcai-fullscreen .vcai-message {
  max-width: min(760px, 88%);
}

.vcai-chat-root.vcai-fullscreen .vcai-product-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vcai-chat-root.vcai-fullscreen .vcai-form {
  grid-template-columns: minmax(0, 1fr) 48px;
  max-width: 960px;
  padding: 14px 24px;
}

.vcai-chat-root.vcai-fullscreen .vcai-send {
  width: 48px;
}

body.vcai-body-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.vcai-structured-links,
.vcai-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.vcai-structured-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(22, 101, 52, 0.25);
  border-radius: 6px;
  color: var(--vcai-color, #166534);
  background: #fff;
  text-decoration: none;
  font-weight: 600;
}

.vcai-feedback-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  line-height: 1;
}

.vcai-feedback.is-sent .vcai-feedback-btn {
  opacity: 0.6;
  cursor: default;
}

.vcai-feedback-detail {
  display: grid;
  gap: 8px;
  flex-basis: 100%;
  max-width: 280px;
  padding: 10px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
}

.vcai-feedback-detail label {
  display: grid;
  gap: 4px;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}

.vcai-feedback-detail select,
.vcai-feedback-detail textarea {
  width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 6px 8px;
  color: #111827;
  font: inherit;
  resize: vertical;
}

.vcai-feedback-submit {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--vcai-color, #166534);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

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

  .vcai-chat-root[data-position="bottom_left"] {
    left: 14px;
  }

  .vcai-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .vcai-chat-root.vcai-fullscreen {
    display: block;
    padding: 0;
    background: transparent;
  }

  .vcai-chat-root.vcai-fullscreen .vcai-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .vcai-chat-root.vcai-fullscreen .vcai-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .vcai-chat-root.vcai-fullscreen .vcai-messages {
    padding: 14px;
  }

  .vcai-chat-root.vcai-fullscreen .vcai-message {
    max-width: 92%;
  }

  .vcai-chat-root.vcai-fullscreen .vcai-product-cards {
    grid-template-columns: 1fr;
  }

  .vcai-chat-root.vcai-fullscreen .vcai-form {
    max-width: none;
    padding: 10px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .vcai-launcher {
    min-width: var(--vcai-launcher-button-size, 96px);
    height: var(--vcai-launcher-button-size, 96px);
  }
}

@media (max-width: 480px) {
  .vcai-launcher {
    width: var(--vcai-launcher-mobile-button-size, 88px);
    min-width: var(--vcai-launcher-mobile-button-size, 88px);
    height: var(--vcai-launcher-mobile-button-size, 88px);
    aspect-ratio: 1 / 1;
  }

  .vcai-launcher[data-shape="pill"] {
    width: auto;
    min-width: var(--vcai-launcher-mobile-button-size, 88px);
    height: var(--vcai-launcher-mobile-button-size, 88px);
  }

  .vcai-launcher.vcai-launcher-has-custom-icon[data-has-text="false"] {
    width: var(--vcai-launcher-mobile-button-size, 88px);
    min-width: var(--vcai-launcher-mobile-button-size, 88px);
    height: var(--vcai-launcher-mobile-button-size, 88px);
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 50%;
  }

  .vcai-launcher-icon-wrap {
    width: var(--vcai-launcher-mobile-icon-size, 76px);
    height: var(--vcai-launcher-mobile-icon-size, 76px);
    aspect-ratio: 1 / 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vcai-launcher,
  .vcai-launcher-icon-wrap {
    transition: none;
    animation: none !important;
    will-change: auto;
  }

  .vcai-launcher:hover,
  .vcai-launcher:focus-visible,
  .vcai-launcher.vcai-launcher-pressed,
  .vcai-launcher:hover .vcai-launcher-icon-wrap,
  .vcai-launcher:focus-visible .vcai-launcher-icon-wrap,
  .vcai-launcher.vcai-launcher-pressed .vcai-launcher-icon-wrap {
    transform: none;
  }
}
