/* ===== SPROUT CHATBOT ===== */
.sprout-launcher {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg), 0 4px 20px rgba(35, 85, 52, 0.35);
  z-index: 9991;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.sprout-launcher:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg), 0 6px 26px rgba(35, 85, 52, 0.5);
}

.sprout-launcher svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sprout-launcher .sprout-icon-open { display: block; }
.sprout-launcher .sprout-icon-close { display: none; }
.sprout-launcher.is-open .sprout-icon-open { display: none; }
.sprout-launcher.is-open .sprout-icon-close { display: block; }

.sprout-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-400);
  border: 2px solid var(--bg-primary);
}

.sprout-window {
  position: fixed;
  bottom: 172px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 200px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 20px 60px rgba(0, 0, 0, 0.2);
  z-index: 9992;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.sprout-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.sprout-header {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sprout-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sprout-header-avatar svg {
  width: 22px;
  height: 22px;
}

.sprout-header-text {
  flex: 1;
  min-width: 0;
}

.sprout-header-text h4 {
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}

.sprout-header-text p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sprout-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ee7a8;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(110, 231, 168, 0.3);
}

.sprout-header-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  transition: background var(--transition-fast);
}

.sprout-header-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sprout-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-secondary);
}

.sprout-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.sprout-msg-bot {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.sprout-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sprout-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.sprout-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: sprout-bounce 1.2s infinite ease-in-out;
}

[data-theme="dark"] .sprout-msg-bot {
  color: #1a2e1f;
}

[data-theme="dark"] .sprout-typing span {
  background: #6a7d6e;
}

.sprout-typing span:nth-child(2) { animation-delay: 0.15s; }
.sprout-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sprout-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.sprout-input-row {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.sprout-input-row textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  max-height: 90px;
  line-height: 1.4;
}

.sprout-input-row textarea:focus {
  outline: none;
  border-color: var(--green-400);
}

.sprout-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.sprout-send-btn:hover { transform: scale(1.06); }
.sprout-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.sprout-send-btn svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .sprout-launcher {
    bottom: 86px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
  .sprout-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}
