/* Chat page layout */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 73px);
  max-width: 1200px;
  margin: 0 auto;
}

/* Sidebar */
.chat-sidebar {
  padding: 48px 36px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 20px;
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 16px;
}
.sidebar-body {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.75;
  margin-bottom: 40px;
}
.sidebar-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-muted);
  transition: color 0.3s;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 1.5px solid var(--fg-muted);
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}
.step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}
.step-dot.done {
  background: rgba(249,115,22,0.4);
  border-color: var(--accent);
}

/* Chat container */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message {
  display: flex;
  max-width: 72%;
}
.message-user {
  align-self: flex-end;
  justify-content: flex-end;
}
.message-assistant {
  align-self: flex-start;
}
.bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
}
.message-user .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.message-assistant .bubble {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.bubble.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 20px;
}
.bubble.typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--fg-muted);
  border-radius: 50%;
  animation: blink 1.4s infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* Input */
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 48px 28px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus {
  border-color: rgba(249, 115, 22, 0.5);
}
.chat-input::placeholder { color: var(--fg-muted); }
.chat-send {
  width: 46px;
  height: 46px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send:hover:not(:disabled) { opacity: 0.85; }

/* Lead report card */
.lead-report {
  margin: 0 48px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
}
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.report-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.report-score-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.report-score {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.report-score-label {
  font-size: 14px;
  color: var(--fg-muted);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.report-field-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.report-field-value {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.4;
}
.report-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  letter-spacing: 0.01em;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s;
}
.btn-outline:hover { border-color: var(--fg-muted); }

/* Responsive */
@media (max-width: 768px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-messages { padding: 24px 20px; }
  .chat-input-wrap { padding: 16px 20px 20px; }
  .lead-report { margin: 0 20px 20px; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .message { max-width: 90%; }
}
