/* Brain Console - chat UI */
.brain-chat-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  max-width: 1280px;
  padding: 16px;
}

.brain-chat-sidebar {
  background: var(--bg-color, #fff);
  border: 1px solid var(--border-color, #e6e6e6);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
}

.bc-sidebar-header {
  margin-bottom: 12px;
}

.bc-session-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bc-session-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-session-item:hover {
  background: #f0f4ff;
}

.bc-session-item.active {
  background: #e8efff;
  color: #1f4cff;
  font-weight: 500;
}

.brain-chat-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg-color, #fff);
  border: 1px solid var(--border-color, #e6e6e6);
  border-radius: 8px;
  overflow: hidden;
}

.bc-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e6e6e6);
}

.bc-title {
  margin: 0;
  font-size: 18px;
}

.bc-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bc-control-label {
  font-size: 12px;
  color: #666;
  margin: 0;
}

.bc-tier {
  width: 130px;
  font-size: 13px;
}

.bc-messages {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bc-empty {
  color: #888;
  font-size: 14px;
  margin: auto;
}

.bc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bc-msg.user {
  align-self: flex-end;
  background: #1f4cff;
  color: #fff;
}

.bc-msg.assistant {
  align-self: flex-start;
  background: #f3f5f9;
  color: #111;
}

.bc-tier-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  background: #e8efff;
  color: #1f4cff;
}

.bc-tier-badge.reason   { background: #fff5e0; color: #b46d00; }
.bc-tier-badge.generate { background: #ffe8f0; color: #c1185b; }

.bc-meta {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.bc-sources {
  margin-top: 8px;
  font-size: 12px;
  color: #555;
  border-top: 1px solid #e6e6e6;
  padding-top: 6px;
}

.bc-source {
  display: block;
  padding: 2px 0;
}

.bc-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-color, #e6e6e6);
}

.bc-textarea {
  flex: 1;
  resize: vertical;
  font-size: 14px;
}

.bc-send {
  align-self: flex-end;
  min-width: 80px;
}

@media (max-width: 768px) {
  .brain-chat-shell {
    grid-template-columns: 1fr;
  }
  .brain-chat-sidebar {
    display: none;
  }
}
