/* ─── Launcher Buttons ─────────────────────────────────── */
.chat-launchers {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  transition: opacity 0.2s, transform 0.2s;
}
.chat-launchers--hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.chat-launcher {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.2s cubic-bezier(0.4,0,0.2,1);
}
.chat-launcher:hover {
  transform: translateY(-2px);
}
.chat-launcher svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.chat-launcher--primary {
  background: #C8913A;
  color: #fff;
}
.chat-launcher--primary:hover {
  box-shadow: 0 8px 28px rgba(200,145,58,0.35);
}

.chat-launcher--secondary {
  background: #1A1916;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
}
.chat-launcher--secondary:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

/* ─── Chat Panel (shared) ─────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 901;
  width: 380px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: #1A1916;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  font-family: 'Jost', system-ui, sans-serif;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4,0,0.2,1),
              transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.chat-panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ─── Header ──────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-header__title {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.chat-header__close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.chat-header__close:hover { color: rgba(255,255,255,0.7); }

/* Proposal header accent */
.chat-header--proposal {
  border-bottom-color: rgba(200,145,58,0.2);
}
.chat-header--proposal .chat-header__title {
  color: #C8913A;
}

/* ─── Progress Bar ────────────────────────────────────── */
.chat-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-progress__bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.chat-progress__fill {
  height: 100%;
  width: 0%;
  background: #C8913A;
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.chat-progress__label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}

/* ─── Messages ────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.chat-msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.6;
  border-radius: 6px;
  word-wrap: break-word;
}
.chat-msg--user {
  align-self: flex-end;
  background: #C8913A;
  color: #fff;
  border-bottom-right-radius: 2px;
}
.chat-msg--assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  border-bottom-left-radius: 2px;
}
.chat-msg--error {
  align-self: flex-start;
  background: rgba(255,80,80,0.12);
  color: rgba(255,180,180,0.8);
  border-bottom-left-radius: 2px;
}

/* ─── Typing indicator ────────────────────────────────── */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.7rem 1rem;
  align-self: flex-start;
}
.chat-typing__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  animation: chatTypingBounce 1.2s ease-in-out infinite;
}
.chat-typing__dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ─── Input ───────────────────────────────────────────── */
.chat-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-input__field {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input__field::placeholder { color: rgba(255,255,255,0.2); }
.chat-input__field:focus { border-color: #C8913A; }
.chat-input__field:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.chat-input__send {
  background: #C8913A;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.chat-input__send:hover { background: #A87428; }
.chat-input__send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-input__send svg { width: 16px; height: 16px; fill: currentColor; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 6rem);
    bottom: 0.75rem;
    right: 0.75rem;
  }
  .chat-launchers {
    bottom: 1rem;
    right: 1rem;
  }
}
