/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0e0e10;
  display: grid;
  place-items: center;
}

/* Optional demo background */
.demo-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.demo-bg__blob {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
}
.demo-bg__blob--1 {
  top: -140px;
  left: -160px;
  background: radial-gradient(circle, #a78bfa 0%, transparent 60%);
}
.demo-bg__blob--2 {
  bottom: -180px;
  right: -160px;
  background: radial-gradient(circle, #ec4899 0%, transparent 60%);
}
.demo-label {
  position: fixed;
  left: 24px;
  bottom: 18px;
  margin: 0;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* Widget */
.vb {
  width: 340px;
  height: 660px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(40px);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25), 0 2px 0 rgba(255,255,255,.8) inset;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.6);
}

/* Header */
.vb-header {
  background: linear-gradient(135deg, #1a1040, #2d1b69);
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  overflow: hidden;
}
.vb-header-bg {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  border-radius: 50%;
}
.vb-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d28d9, #a78bfa);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(109,40,217,.5);
  z-index: 1;
}
.vb-header-text { flex: 1; z-index: 1; }
.vb-name {
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.2px;
}
.vb-tagline {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  margin-top: 2px;
}
.vb-dots { display: flex; gap: 6px; z-index: 1; }
.vb-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7);
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
}
.vb-dot:active { transform: translateY(1px); }

/* Chips */
.vb-chips {
  padding: 14px 16px 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #f8f7ff;
  border-bottom: 1px solid #ede9fe;
}
.vb-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #ede9fe;
  color: #5b21b6;
  cursor: pointer;
  border: 1px solid rgba(109,40,217,.15);
}
.vb-chip:hover { background: #ddd6fe; }

/* Messages */
.vb-messages {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafaf9;
  min-height: 180px;

  flex: 1;
  overflow-y: auto;
}
.vb-msg-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
}
.vb-msg-row.user { flex-direction: row-reverse; }

.vb-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6d28d9, #a78bfa);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
  color: #fff;
}

.vb-bubble {
  max-width: 235px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.55;
}
.vb-bubble.agent {
  background: #fff;
  color: #1e1b4b;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08), 0 1px 0 rgba(0,0,0,.04);
}
.vb-bubble.user {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  color: #ede9fe;
  border-radius: 16px 4px 16px 16px;
}

/* Markdown inside agent bubbles */
.vb-bubble.agent p { margin: 0 0 0.5em; }
.vb-bubble.agent p:last-child { margin-bottom: 0; }
.vb-bubble.agent ul,
.vb-bubble.agent ol { margin: 0.25em 0 0.5em 1.2em; padding: 0; }
.vb-bubble.agent li { margin-bottom: 0.2em; }
.vb-bubble.agent strong { font-weight: 700; }
.vb-bubble.agent em { font-style: italic; }
.vb-bubble.agent h1,
.vb-bubble.agent h2,
.vb-bubble.agent h3 { font-size: 1em; font-weight: 700; margin: 0.5em 0 0.25em; }
.vb-bubble.agent code {
  background: #f0eeff;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.9em;
}

/* CTA */
.vb-cta {
  width: calc(100% - 32px);
  margin: 0 16px 14px;
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: none;
}
.vb-cta:active { transform: translateY(1px); }

.vb-cta-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.vb-cta-text { flex: 1; text-align: left; }
.vb-cta-label { font-size: 12px; color: rgba(255,255,255,.65); }
.vb-cta-action { font-weight: 800; font-size: 14px; color: #fff; }
.vb-cta-arrow { font-size: 18px; color: rgba(255,255,255,.55); }

/* Footer */
.vb-footer {
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #ede9fe;
  display: flex;
  gap: 8px;
  align-items: center;
}
.vb-input {
  flex: 1;
  background: #f5f3ff;
  border: 1.5px solid #ede9fe;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #111827;
  outline: none;
}
.vb-send {
  width: 38px;
  height: 38px;
  border: none;
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,36,149,.4);
}
.arrow-icon {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Footer label */
.vb-powered {
  text-align: center;
  font-size: 10px;
  color: #aaa;
  padding: 8px 7px;
  letter-spacing: 1px;
  background: #fff;
}

.vb-messages::-webkit-scrollbar {
  width: 6px;
}

.vb-messages::-webkit-scrollbar-thumb {
  background: rgba(109,40,217,0.3);
  border-radius: 10px;
}

.loader {
  width: 40px;
  aspect-ratio: 4;
  --_g: no-repeat radial-gradient(circle closest-side, #a78bfa 90%, #0000);
  background: 
    var(--_g) 0%   50%,
    var(--_g) 50%  50%,
    var(--_g) 100% 50%;
  background-size: calc(100%/3) 100%;
  animation: l7 1s infinite linear;
}
@keyframes l7 {
    33%{background-size:calc(100%/3) 0%  ,calc(100%/3) 100%,calc(100%/3) 100%}
    50%{background-size:calc(100%/3) 100%,calc(100%/3) 0%  ,calc(100%/3) 100%}
    66%{background-size:calc(100%/3) 100%,calc(100%/3) 100%,calc(100%/3) 0%  }
}