/* Chat entries list + chat thread window. */

.chat-entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.chat-entry-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.chat-entry-body {
  flex: 1;
  min-width: 0;
}

.chat-entry-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.chat-entry-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chat-entry-arrow {
  font-size: 22px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.chat-tier-row {
  margin-bottom: 12px;
}

.chat-window {
  background: var(--card);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-brutal);
}

.chat-messages {
  height: 55vh;
  min-height: 300px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: var(--radius-xs);
  white-space: pre-wrap;
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--card-2);
  color: var(--text);
  border-bottom-left-radius: var(--radius-xs);
}

.chat-bubble-pending {
  color: var(--text-tertiary);
  font-style: italic;
}

.chat-bubble-error {
  color: var(--danger);
  white-space: pre-wrap;
}

.chat-bubble.markdown-body {
  padding-top: 8px;
  padding-bottom: 8px;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  background: var(--card-2);
  border: var(--border-width-sm) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-send-btn {
  flex-shrink: 0;
}
