:root {
  --vcai-accent: #f55b16;
  --vcai-success: #9cc26b;
  --vcai-dark: #111111;
  --vcai-soft-bg: #faf6f1;
}

.vcai-agent-root,
.vcai-agent-root * {
  box-sizing: border-box;
}

.vcai-widget {
  --shadow: 0 22px 70px rgba(0, 0, 0, .18);
  font-family: inherit;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999998;
}

.vcai-widget.is-inline {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  z-index: 1;
}

.vcai-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(17, 17, 17, .18);
  background: var(--vcai-dark);
  color: #fff;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}

.vcai-launcher:hover,
.vcai-launcher:focus {
  background: var(--vcai-success);
  color: #111;
  transform: translateY(-2px);
}

.vcai-launcher-dot {
  width: 10px;
  height: 10px;
  background: var(--vcai-accent);
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(245, 91, 22, .16);
}

.vcai-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(420px, calc(100vw - 32px));
  height: min(650px, calc(100vh - 120px));
  background: #fff;
  color: #111;
  border: 1px solid rgba(17, 17, 17, .12);
  box-shadow: var(--shadow);
  border-radius: 24px;
  overflow: hidden;
  display: none;
  grid-template-rows: auto 1fr auto auto auto;
}

.vcai-widget[data-open="true"] .vcai-panel,
.vcai-widget.is-inline .vcai-panel {
  display: grid;
}

.vcai-widget.is-inline .vcai-panel {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  min-height: 560px;
  height: 620px;
}

.vcai-panel-head {
  background: var(--vcai-soft-bg);
  border-bottom: 1px solid rgba(17, 17, 17, .1);
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vcai-panel-head strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: .01em;
}

.vcai-panel-head span {
  display: block;
  color: #666;
  font-size: 12px;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.vcai-close {
  border: 0;
  background: #fff;
  color: #111;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.vcai-widget.is-inline .vcai-close {
  display: none;
}

.vcai-messages {
  overflow-y: auto;
  padding: 18px;
  background: linear-gradient(180deg, #fff 0%, #fff 70%, var(--vcai-soft-bg) 100%);
}

.vcai-message {
  display: flex;
  margin: 0 0 12px;
}

.vcai-message-user {
  justify-content: flex-end;
}

.vcai-message-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  border: 1px solid rgba(17, 17, 17, .09);
}

.vcai-message-assistant .vcai-message-bubble {
  background: #fff;
  border-top-left-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .045);
}

.vcai-message-user .vcai-message-bubble {
  background: var(--vcai-dark);
  color: #fff;
  border-color: var(--vcai-dark);
  border-top-right-radius: 6px;
}

.vcai-quick-actions,
.vcai-handoff-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-top: 1px solid rgba(17, 17, 17, .08);
  background: #fff;
}

.vcai-quick-actions button,
.vcai-handoff-bar button {
  appearance: none;
  border: 1px solid rgba(17, 17, 17, .15);
  background: #fff;
  color: #111;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.vcai-quick-actions button:hover,
.vcai-handoff-bar button:hover {
  background: var(--vcai-success);
  color: #111;
  border-color: var(--vcai-success);
}

.vcai-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(17, 17, 17, .08);
  background: #fff;
}

.vcai-form textarea {
  width: 100%;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 14px;
  border: 1px solid rgba(17, 17, 17, .18);
  border-radius: 14px;
  font: inherit;
  line-height: 1.4;
  outline: none;
}

.vcai-form textarea:focus {
  border-color: var(--vcai-accent);
  box-shadow: 0 0 0 3px rgba(245, 91, 22, .12);
}

.vcai-form button {
  border: 0;
  background: var(--vcai-dark);
  color: #fff;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.vcai-form button:hover {
  background: var(--vcai-success);
  color: #111;
}

.vcai-handoff-bar {
  justify-content: space-between;
  background: var(--vcai-soft-bg);
}

.vcai-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.vcai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--vcai-accent);
  animation: vcaiPulse 1s infinite ease-in-out;
}

.vcai-typing i:nth-child(2) { animation-delay: .15s; }
.vcai-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes vcaiPulse {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 640px) {
  .vcai-widget {
    right: 14px;
    bottom: 14px;
  }
  .vcai-panel {
    width: calc(100vw - 28px);
    height: min(650px, calc(100vh - 96px));
    bottom: 62px;
    border-radius: 20px;
  }
  .vcai-message-bubble {
    max-width: 94%;
  }
  .vcai-quick-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .vcai-quick-actions button {
    white-space: nowrap;
  }
}
