.page {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  padding: 32px;
  color: #0f172a;
}

:root {
  --vibeai-accent: #7c3aed;
  --vibeai-accent2: #06b6d4;
  --vibeai-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --vibeai-space: 10px;
}

.vibeai-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(600px 240px at 20% 10%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(124, 58, 237, 0.98), rgba(6, 182, 212, 0.92));
  color: white;
  box-shadow: var(--vibeai-shadow);
  border-radius: 999px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  backdrop-filter: blur(10px);
  transform: translateZ(0);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.vibeai-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.vibeai-fab:active {
  transform: translateY(0px) scale(0.99);
}

.vibeai-fab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.35), var(--vibeai-shadow);
}

.vibeai-fab-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 16px;
  flex: 0 0 auto;
}

.vibeai-fab-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.vibeai-fab-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.18),
    0 0 22px rgba(255, 255, 255, 0.55);
  opacity: 0.9;
  flex: 0 0 auto;
  animation: vibeaiPulse 2.2s ease-in-out infinite;
}

@keyframes vibeaiPulse {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

.vibeai-fab strong {
  font-size: 14px;
  line-height: 1;
}

.vibeai-fab span {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1;
}

.vibeai-drawer {
  position: fixed;
  right: 18px;
  bottom: 82px;
  width: min(560px, calc(100vw - 24px));
  height: min(800px, calc(100vh - 24px));
  z-index: 9999;
  display: none;
}

.vibeai-drawer[data-open="true"] {
  display: flex;
  flex-direction: column;
}

.vibeai-drawer,
.vibeai-drawer * {
  box-sizing: border-box;
}

.vibeai-macbook-window {
  background: #f5f5f7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--vibeai-shadow);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: min(800px, calc(100vh - 24px));
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.vibeai-window-header {
  background: #2d2d2d;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vibeai-window-controls {
  display: flex;
  gap: 6px;
}

.vibeai-control {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.vibeai-control.close { background: #ff5f57; }
.vibeai-control.minimize { background: #ffbd2e; }
.vibeai-control.maximize { background: #28ca42; }

.vibeai-window-title {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  flex: 1;
  text-align: center;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vibeai-close {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}

.vibeai-window-body {
  display: flex;
  min-height: 72vh;
  background: #ffffff;
  flex: 1 1 auto;
  min-height: 0;
}

.vibeai-chat-container {
  position: relative;
  flex: 1;
  padding: 18px 18px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vibeai-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9e9ee;
  margin-bottom: 10px;
}

.vibeai-chatbot-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  animation: vibeaiAvatarPulse 2s infinite;
  flex: 0 0 auto;
  overflow: hidden;
}

.vibeai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: contrast(1.05) saturate(1.05);
}

@keyframes vibeaiAvatarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.vibeai-chatbot-info h3 {
  color: #111827;
  font-size: 15px;
  margin: 0 0 2px 0;
}

.vibeai-chatbot-info p {
  color: #6b7280;
  font-size: 12px;
  margin: 0;
}

.vibeai-chat-status {
  margin-left: auto;
}

.vibeai-status-dot {
  width: 10px;
  height: 10px;
  background: #28ca42;
  border-radius: 50%;
  display: block;
  animation: vibeaiGlow 1.5s infinite;
}

@keyframes vibeaiGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(40, 202, 66, 0.45); }
  50% { box-shadow: 0 0 16px rgba(40, 202, 66, 0.75); }
}

.vibeai-chat-messages {
  overflow-y: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  scroll-behavior: smooth;
}

.vibeai-message {
  max-width: 92%;
  animation: vibeaiSlideIn .25s ease-out;
}

@keyframes vibeaiSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.vibeai-message.bot { margin-right: auto; }
.vibeai-message.user { margin-left: auto; }

.vibeai-message-content {
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.vibeai-attachments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.vibeai-attachment {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.vibeai-message.user .vibeai-attachment {
  border-color: rgba(255, 255, 255, 0.25);
}

.vibeai-attachment-img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  display: block;
}

.vibeai-message.bot .vibeai-message-content {
  background: #f0f2f5;
  color: #111827;
  border-top-left-radius: 6px;
}

.vibeai-message.user .vibeai-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.vibeai-chat-btn-wrap {
  margin-top: 10px;
}

.vibeai-chat-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  transition: transform .2s ease, filter .2s ease;
}

.vibeai-chat-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.vibeai-chat-btn:active {
  transform: scale(0.99);
}

.vibeai-message-time {
  font-size: 11px;
  color: #9aa0a6;
  margin-top: 4px;
  text-align: right;
}

.vibeai-typing {
  align-items: center;
}

.vibeai-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #f0f2f5;
  border-radius: 18px;
  border-top-left-radius: 6px;
}

.vibeai-typing-indicator span {
  width: 8px;
  height: 8px;
  background: #9aa0a6;
  border-radius: 50%;
  animation: vibeaiBounce 1.4s infinite ease-in-out;
}

.vibeai-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;
}

.vibeai-window-footer {
  background: #fff;
  padding: 14px 18px 18px;
  border-top: 1px solid #e9e9ee;
  flex: 0 0 auto;
  max-height: 550px;
  overflow: auto;
}

.vibeai-window-footer[data-hidden="true"] {
  display: none;
}

.vibeai-form {
  display: flex;
  flex-direction: column;
  gap: var(--vibeai-space);
}

.vibeai-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.vibeai-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.vibeai-step span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
}

.vibeai-step[data-active="true"] { color: #111827; }
.vibeai-step[data-active="true"] span {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.vibeai-step-line {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
  min-width: 10px;
}

.vibeai-step-panel {
  display: flex;
  flex-direction: column;
  gap: var(--vibeai-space);
}

.vibeai-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--vibeai-space);
  align-items: start;
}

.vibeai-subtitle {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}

.vibeai-field { display: flex; flex-direction: column; gap: 0; }

.vibeai-field input,
.vibeai-field select,
.vibeai-field textarea {
  width: 100%;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  border-radius: 20px;
  padding: 16px 16px;
  outline: none;
  font-size: 15px;
  transition: border-color .2s ease, box-shadow .2s ease;
  min-width: 0;
  margin: 0;
  display: block;
}

.vibeai-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 52px;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 26px) calc(50% - 2px),
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 52px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 20px;
  background-repeat: no-repeat;
}

.vibeai-field select::-ms-expand {
  display: none;
}

.vibeai-field textarea {
  resize: none;
}

.vibeai-field input:focus,
.vibeai-field select:focus,
.vibeai-field textarea:focus {
  border-color: rgba(102, 126, 234, 0.85);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.18);
}

.vibeai-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.vibeai-seg-btn {
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  border-radius: 20px;
  padding: 16px 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  transition: transform .2s ease, border-color .2s ease;
}

.vibeai-seg-btn:hover { transform: translateY(-1px); }
.vibeai-seg-btn[data-active="true"] {
  border-color: rgba(102, 126, 234, 0.65);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(118, 75, 162, 0.25);
}

.vibeai-upload {
  border: 2px solid #e5e7eb;
  background: #ffffff;
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vibeai-upload input[type="file"] {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  font-size: 14px;
}

.vibeai-upload input[type="file"]::file-selector-button {
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 999px;
  padding: 12px 14px;
  margin-right: 12px;
  font-weight: 800;
  cursor: pointer;
}

.vibeai-upload input[type="file"]::file-selector-button:hover {
  filter: brightness(1.05);
}

.vibeai-files-meta { color: #6b7280; font-size: 13px; }

.vibeai-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 16px;
  padding: 12px;
}

.vibeai-consent input {
  margin-top: 2px;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 2px solid #d1d5db;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.vibeai-consent input:checked {
  border-color: rgba(102, 126, 234, 0.85);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.vibeai-consent input:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #fff;
}
.vibeai-consent p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.35; }

.vibeai-actions { display: flex; gap: 10px; align-items: center; }

.vibeai-step-panel > * {
  margin: 0;
}

.vibeai-btn {
  border-radius: 999px;
  padding: 16px 16px;
  cursor: pointer;
  font-weight: 800;
  border: none;
  background: #f3f4f6;
  color: #111827;
  transition: transform .2s ease;
  font-size: 15px;
}

.vibeai-btn:hover { transform: scale(1.02); }
.vibeai-btn:disabled { opacity: .55; cursor: not-allowed; }
.vibeai-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.vibeai-btn-primary:active {
  transform: scale(0.99);
}
.vibeai-btn-ghost { background: #f3f4f6; }

.vibeai-note {
  width: 100%;
  min-height: 92px;
}

.vibeai-hint { color: #6b7280; font-size: 12px; }

.vibeai-error {
  color: #7f1d1d;
  font-size: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 14px;
  padding: 8px 10px;
}

@keyframes vibeaiBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.vibeai-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.vibeai-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

/* Scrollbar styling */
.vibeai-chat-messages::-webkit-scrollbar { width: 6px; }
.vibeai-chat-messages::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.vibeai-chat-messages::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.vibeai-chat-messages::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

@media (max-width: 420px) {
  .vibeai-grid { grid-template-columns: 1fr; }
  .vibeai-window-footer { padding: 10px 12px; }
  .vibeai-chat-container { padding: 12px 12px 10px; }
  .vibeai-step { gap: 6px; }
}
