.analyst-context-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -8px 0 16px;
}

.context-chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
}

.context-chip.safe {
  background: var(--positive-soft);
  color: var(--positive);
  border-color: var(--positive-line);
}

.analyst-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
}

.analyst-chat-panel {
  padding: 0;
  overflow: hidden;
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.analyst-messages {
  flex: 1;
  min-height: 480px;
  max-height: 68vh;
  overflow: auto;
  padding: 20px;
  background: var(--surface-2);
}

.analyst-welcome {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  max-width: 780px;
}

.analyst-welcome p {
  margin: 6px 0 0;
  color: var(--muted);
}

.analyst-avatar,
.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.message-avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
  background: var(--ink);
}

.message-avatar.ai {
  background: var(--accent);
  font-size: 16px;
}

.analyst-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0;
}

.analyst-message.user {
  flex-direction: row-reverse;
}

.analyst-message.user .message-bubble {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  max-width: 70%;
}

.message-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  max-width: 88%;
  box-shadow: var(--shadow-sm);
}

.analyst-answer {
  line-height: 1.55;
  color: var(--ink);
  white-space: normal;
}

.analyst-message.user .message-copy {
  color: var(--accent-ink);
}

.analyst-result-table {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.analyst-table-title {
  padding: 9px 11px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.analyst-result-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.analyst-result-table th,
.analyst-result-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.analyst-response-meta {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.follow-up-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.follow-up-chip {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 7px 9px;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
}

.analyst-warning {
  margin-top: 10px;
  padding: 9px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-sm);
  color: var(--warning);
  font-size: 12px;
}

.analyst-composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  background: var(--surface);
}

.analyst-composer textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  font: inherit;
  min-height: 80px;
}

.analyst-composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
}

.analyst-provider-note {
  font-size: 11px;
  color: var(--muted);
}

.analyst-side-panel {
  height: max-content;
}

.prompt-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.prompt-suggestions button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--accent);
}

.prompt-suggestions button:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.analyst-grounding {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.analyst-grounding p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.typing-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 2px;
  animation: typingPulse 1.1s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: .15s;
}

.typing-dot:nth-child(3) {
  animation-delay: .3s;
}

@keyframes typingPulse {
  0%,
  100% {
    opacity: .25;
  }
  50% {
    opacity: 1;
  }
}

