:root {
  --bg: #0b0f14;
  --bg-secondary: #111820;
  --bg-sidebar: #0e141b;
  --text: #e6edf3;
  --text-muted: #8b98a5;
  --accent: #6e56cf;
  --accent-hover: #7d68d8;
  --border: #1f2a36;
  --bubble-user: #6e56cf;
  --bubble-bot: #161d26;
  --sidebar-width: 280px;
}

* { box-sizing: border-box; }

html, body, #root { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
}

#root { display: flex; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.logo { font-weight: 700; letter-spacing: 0.5px; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { background: #1a2330; color: var(--text); }

.history-label { padding: 0 16px 8px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; }

.history-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; }

.history-item {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
}

.history-item:hover { background: #1a2330; color: var(--text); }
.history-item.active { background: #1a2330; color: var(--text); }

.sidebar-overlay { display: none; }

.main { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }

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

.empty-state { margin: auto; text-align: center; color: var(--text-muted); }

.empty-state h1 { color: var(--text); font-size: 24px; }

.message { max-width: 75%; padding: 12px 16px; border-radius: 16px; animation: fadeIn 0.2s ease; }

.message.user { align-self: flex-end; background: var(--bubble-user); color: white; border-bottom-right-radius: 4px; }

.message.bot { align-self: flex-start; background: var(--bubble-bot); border: 1px solid var(--border); border-bottom-left-radius: 4px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.composer { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--border); background: var(--bg-secondary); }

.composer textarea {
  flex: 1;
  resize: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.composer textarea:focus { outline: none; border-color: var(--accent); }

.send-btn { background: var(--accent); color: white; border: none; border-radius: 12px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

.send-btn:hover { background: var(--accent-hover); }

@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 30; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 20; }
  .message { max-width: 85%; }
}