:root {
  --chat-bg: #f8fafc;
  --bubble-user-bg: #0f172a;
  --bubble-user-text: #ffffff;
  --bubble-ai-bg: #ffffff;
  --bubble-ai-text: #0f172a;
  --bubble-border: #e5e7eb;
}

html, body {
  height: 100%;
}

.sidebar {
  min-height: calc(100vh - 56px);
  background: #fffbeb; /* amber-50-ish */
}

.avatar {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.chat-shell {
  position: relative;
  min-height: calc(100vh - 56px);
  background: var(--chat-bg);
}

.chat-content {
  padding: 16px;
  padding-bottom: 140px; /* input + footer */
  max-width: 980px;
  margin: 0 auto;
}

.message-row {
  display: flex;
  margin-bottom: 12px;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.bubble {
  border-radius: 18px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bubble.user {
  background: var(--bubble-user-bg);
  color: var(--bubble-user-text);
  max-width: 80%;
}

.bubble.assistant {
  background: var(--bubble-ai-bg);
  color: var(--bubble-ai-text);
  border: 1px solid var(--bubble-border);
  width: 100%;
}

.typing {
  display: inline-block;
}

.typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #94a3b8;
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.chat-input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 44px; /* footer height */
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid #e5e7eb;
}

.footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
}

.usage-bar {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px 8px;
  color: #475569;
  font-size: 12px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-item {
  text-align: left;
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 10px;
  cursor: pointer;
}

.chat-item:hover {
  border-color: #cbd5e1;
}

.chat-item.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.chat-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.chat-item-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
