/* Prop AI Hub — Chat Widget */
#prop-ai-chat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pai-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1a56db;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: background .2s;
}
.pai-toggle:hover { background: #1648c4; }

.pai-window {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 340px;
  max-height: 540px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.pai-header {
  background: #1a56db;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pai-header-info { display: flex; align-items: center; gap: 10px; }
.pai-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.pai-header-name { font-weight: 600; font-size: 14px; }
.pai-header-status { font-size: 11px; opacity: .8; margin-top: 1px; }
.pai-close {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
}

/* Messages */
.pai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pai-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.pai-msg--user {
  align-self: flex-end;
  background: #1a56db;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pai-msg--assistant {
  align-self: flex-start;
  background: #f3f4f6;
  color: #111827;
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.pai-msg--loading {
  display: flex; gap: 4px; align-items: center;
  padding: 12px 16px;
}
.pai-msg--loading span {
  width: 7px; height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  animation: pai-bounce 1.2s infinite;
}
.pai-msg--loading span:nth-child(2) { animation-delay: .2s; }
.pai-msg--loading span:nth-child(3) { animation-delay: .4s; }
@keyframes pai-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Lead capture form */
.pai-lead-form {
  margin: 0 12px 12px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px;
}
.pai-lead-form-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
  margin: 0 0 10px;
}
.pai-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  background: #fff;
}
.pai-field:focus { border-color: #1a56db; }
.pai-lead-submit {
  width: 100%;
  background: #f5a623;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.pai-lead-submit:hover { background: #d4891a; }
.pai-lead-submit:disabled { opacity: .6; cursor: default; }

/* Input row */
.pai-input-row {
  display: flex;
  border-top: 1px solid #e5e7eb;
  padding: 10px 12px;
  gap: 8px;
}
.pai-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}
.pai-input:focus { border-color: #1a56db; }
.pai-send {
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  display: flex; align-items: center;
  transition: background .2s;
}
.pai-send:hover { background: #1648c4; }

@media (max-width: 400px) {
  .pai-window { width: calc(100vw - 32px); right: -8px; }
}
