* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --bg-elevated: #1a1a1a;
  --bg-hover: #222;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #737373;
  --text-dim: #525252;
  --accent: #c9a44a;
  --accent-dim: rgba(201, 164, 74, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Nav ─────────────────────────────────── */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.topnav-brand svg {
  width: 24px;
  height: 24px;
}

.topnav-tabs {
  display: flex;
  gap: 4px;
}

.topnav-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.3px;
}

.topnav-tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.topnav-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.topnav-status {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Main Content ────────────────────────────── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.view.active {
  display: flex;
}

/* ── Chat View ───────────────────────────────── */

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  text-align: center;
  padding: 48px 24px;
}

.chat-welcome h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.chat-welcome p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 440px;
  line-height: 1.6;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.chat-message-role.gilgamesh {
  color: var(--accent);
}

.chat-message-content {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.chat-input-area {
  padding: 16px 0 24px;
  border-top: 1px solid var(--border);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input::placeholder {
  color: var(--text-dim);
}

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

.chat-send {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.chat-send:hover {
  opacity: 0.85;
}

.chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Placeholder Views ───────────────────────── */

.placeholder-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}

.placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.placeholder-view h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.placeholder-view p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 400px;
  line-height: 1.6;
}

.placeholder-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Scrollbar ───────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}
