/* Sage intake chat widget — spotonhouses.com */
.sage-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sage-hidden { display: none !important; }

.sage-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--yellow, #FFD700);
  border: 2px solid var(--black, #111);
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.sage-bubble:hover { transform: scale(1.06); }

.sage-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--black, #111);
}

.sage-header {
  background: var(--black, #111);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.sage-header-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.sage-header-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.sage-close {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; line-height: 1;
  padding: 0 4px;
}

.sage-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f9f9;
}

.sage-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.sage-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e5e5;
  color: #111;
  border-bottom-left-radius: 4px;
}
.sage-msg-user {
  align-self: flex-end;
  background: var(--yellow, #FFD700);
  color: #111;
  border-bottom-right-radius: 4px;
}

.sage-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.sage-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #aaa;
  animation: sage-bounce 1.2s infinite ease-in-out;
}
.sage-typing span:nth-child(2) { animation-delay: 0.15s; }
.sage-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sage-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.sage-upload-row {
  padding: 6px 14px;
  background: #fffbe6;
  border-top: 1px solid #eee;
}
.sage-upload-status { font-size: 12px; color: #555; }

.sage-input-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #e5e5e5;
  background: #fff;
}
.sage-attach-btn, .sage-send-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sage-attach-btn:hover, .sage-send-btn:hover { background: #f0f0f0; }
.sage-send-btn { color: var(--black, #111); }

.sage-textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  resize: none;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.3;
  max-height: 120px;
  outline: none;
  box-sizing: border-box;
}
.sage-textarea:focus { border-color: var(--yellow, #FFD700); }

/* Bulletproof visually-hidden pattern for the native file input — display:none
   alone was rendering visibly ("Choose Files / No file chosen") in some
   browsers and squeezing the textarea into a narrow, garbled column.
   This pattern removes it from layout/paint entirely while keeping it
   programmatically clickable via the attach button. */
.sage-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sage-disclaimer {
  font-size: 10px;
  color: #999;
  text-align: center;
  padding: 4px 10px 8px;
  background: #fff;
}

@media (max-width: 480px) {
  .sage-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
  .sage-widget { bottom: 12px; right: 12px; }
}
