:root {
  --bg-primary: #070a13;
  --bg-secondary: #0d1220;
  --bg-card: #131a2e;
  --bg-card-hover: #1b243f;
  --border: #212c47;
  --border-focus: #435380;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --cyan: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --mono-font: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --sans-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--sans-font);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Demo Ribbon Banner */
.demo-ribbon {
  height: 34px;
  background: linear-gradient(90deg, #1e1b4b, #311042, #082f49);
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.78rem;
  color: #e2e8f0;
}

.ribbon-links {
  display: flex;
  gap: 10px;
}

.ribbon-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
  transition: background 0.2s;
}

.ribbon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ribbon-btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header & Top Bar */
header {
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-badge {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.status-indicator {
  font-size: 0.75rem;
  margin-left: 6px;
  color: var(--success);
  font-family: var(--mono-font);
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.telemetry-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.custom-select {
  background: var(--bg-card);
  color: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-family: var(--sans-font);
  outline: none;
  cursor: pointer;
  transition: border 0.2s;
}

.custom-select:hover {
  border-color: var(--border-focus);
}

.action-btn {
  background: #1e263d;
  border: 1px solid var(--border);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #2a3556;
  color: #fff;
}

.gauge-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-family: var(--mono-font);
}

.gauge-label {
  font-weight: 700;
  color: var(--text-muted);
}

.meter-track {
  width: 70px;
  height: 7px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: var(--cyan);
  transition: width 0.3s ease, background-color 0.3s;
}

.gauge-val {
  color: #e2e8f0;
  font-weight: 500;
}

.headroom-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-family: var(--mono-font);
}

/* Split Main Container */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left: Chat Panel */
.chat-panel {
  flex: 5;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-primary);
}

.quick-prompts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(19, 26, 46, 0.5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.chip-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.prompt-chip {
  background: #141d33;
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.prompt-chip:hover {
  background: #232e4d;
  color: #fff;
  border-color: var(--accent);
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-card {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 95%;
  animation: fadeIn 0.25s ease-out;
}

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

.msg-assistant {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  align-self: flex-start;
}

.msg-user {
  background: #1e1b4b;
  border: 1px solid #4338ca;
  color: #e0e7ff;
  align-self: flex-end;
}

.agent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fff;
}

.agent-avatar {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.features-summary {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.tool-invocation-box {
  background: #090e1c;
  border: 1px solid #233152;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-family: var(--mono-font);
  font-size: 0.8rem;
}

.tool-tag {
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 4px;
}

.input-area {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  gap: 10px;
  align-items: center;
}

.mic-button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #fff;
  padding: 0 14px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}

.mic-button:hover {
  background: var(--bg-card-hover);
}

.prompt-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  padding: 10px 14px;
  font-family: var(--sans-font);
  font-size: 0.88rem;
  height: 44px;
  outline: none;
  resize: none;
  transition: border 0.2s;
}

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

.btn-send {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  height: 44px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-send:hover {
  opacity: 0.9;
}

/* Right: Workspace & Diff Panel */
.workspace-panel {
  flex: 6;
  display: flex;
  flex-direction: column;
  background: #090d18;
}

.workspace-tabs {
  height: 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.workspace-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

/* Diff Rendering Styles */
.diff-container {
  background: #0b1020;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono-font);
  font-size: 0.82rem;
  overflow: auto;
}

.diff-header {
  background: #141c33;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

.diff-line {
  padding: 2px 14px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.diff-add {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.diff-del {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.diff-hunk {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-weight: 700;
}

/* Tree & Telemetry styles */
.symbol-tree {
  font-family: var(--mono-font);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #cbd5e1;
}

.tree-file {
  color: var(--cyan);
  font-weight: 700;
}

.tree-sym {
  margin-left: 20px;
  color: #94a3b8;
}

.telemetry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
