:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-glass: rgba(18, 18, 26, 0.8);
  --bg-glass-hover: rgba(30, 30, 45, 0.9);
  --border: rgba(255, 255, 255, 0.06);
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --user-bubble: rgba(99, 102, 241, 0.15);
  --assistant-bubble: rgba(255, 255, 255, 0.03);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* Auth Screen */
.screen { height: 100vh; width: 100vw; }

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
              var(--bg-primary);
}

.auth-card {
  padding: 48px;
  border-radius: 20px;
  text-align: center;
  width: 380px;
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"], input[type="password"], textarea, select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover { background: rgba(255, 255, 255, 0.1); }

.btn-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover { background: rgba(255, 255, 255, 0.05); }

.error { color: var(--error); font-size: 13px; margin-top: 8px; }

/* Main Layout */
#main-screen {
  display: flex;
  height: 100vh;
}

/* Sidebar */
#sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.conversations {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.conv-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.conv-item.active { background: var(--user-bubble); color: var(--text-primary); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.model-selector label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.model-selector select {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#user-name {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Chat Area */
#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#chat-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

#chat-title {
  font-size: 14px;
  font-weight: 500;
}

.badge {
  background: var(--user-bubble);
  color: var(--accent-hover);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant-bubble);
  border: 1px solid var(--border);
  max-width: 85%;
}

.message .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.message pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

.message code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
}

.message p { margin-bottom: 8px; }
.message p:last-child { margin-bottom: 0; }
.message ul, .message ol { padding-left: 20px; margin-bottom: 8px; }
.message table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.message th, .message td { border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; }
.message th { background: rgba(255, 255, 255, 0.05); }

/* Typing indicator */
.typing {
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.typing .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

#typing-model {
  margin-left: 8px;
  font-size: 11px;
}

/* Input */
.input-area {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

#message-input {
  flex: 1;
  resize: none;
  max-height: 200px;
  min-height: 44px;
  padding: 10px 16px;
}

#send-btn {
  height: 44px;
  width: 80px;
  flex-shrink: 0;
}

/* Image paste preview */
.image-preview {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  flex-wrap: wrap;
}

.preview-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.preview-remove:hover { background: var(--error); }

/* Inline message images */
.message-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.message-img {
  max-width: 300px;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
  object-fit: contain;
}

.message-img:hover { opacity: 0.85; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* Conversation items */
.conv-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conv-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-meta {
  font-size: 10px;
  color: var(--text-muted);
}

/* Settings overlay */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.settings-card {
  width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 16px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.settings-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.settings-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h4 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.settings-section input {
  width: 100%;
  margin-bottom: 8px;
}

.btn-block { width: 100%; }

.usage-stats {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.stat-row b {
  color: var(--text-primary);
}

/* Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.tab-btn.active { color: var(--accent-hover); border-bottom-color: var(--accent); }

/* ============================================================
   PAPERCLIP AGENT — Hi-end Dashboard
   ============================================================ */

/* Agent Area — full three-panel layout */
#agent-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* --- Top Bar --- */
#agent-topbar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.agent-topbar-left { display: flex; align-items: center; gap: 12px; }
.agent-topbar-right { display: flex; align-items: center; gap: 12px; }

.agent-brand {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}

.status-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill.idle { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.status-pill.planning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-pill.awaiting_approval { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-pill.running { background: rgba(59,130,246,0.15); color: #3b82f6; animation: pulse-bg 2s infinite; }
.status-pill.completed { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-pill.failed { background: rgba(239,68,68,0.15); color: #ef4444; }

@keyframes pulse-bg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.live-label {
  font-size: 12px;
  color: var(--text-secondary);
  animation: fade-in 0.3s ease;
}

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

.cost-mini {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.cost-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.cost-sep { color: var(--border); }

.btn-icon-sm { width: 30px; height: 30px; font-size: 16px; }

/* --- Workspace (three panels) --- */
#agent-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* --- Left: Timeline Rail --- */
#agent-timeline {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow-y: auto;
}

#agent-new-task-compact {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

#agent-new-task-compact textarea {
  width: 100%;
  margin-bottom: 8px;
  min-height: 56px;
  resize: none;
  font-size: 13px;
  padding: 10px 12px;
}

#agent-timeline-steps {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

/* Timeline step items */
.tl-step {
  display: flex;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.tl-step:hover { background: rgba(255,255,255,0.03); }
.tl-step.active { background: rgba(59,130,246,0.08); }

/* Vertical connector line */
.tl-step::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 36px;
  bottom: -10px;
  width: 2px;
  background: var(--border);
}
.tl-step:last-child::before { display: none; }

.tl-step.running::before { background: var(--accent); }
.tl-step.completed::before { background: rgba(34,197,94,0.4); }

.tl-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}

.tl-step.pending .tl-node { border-color: rgba(255,255,255,0.1); color: var(--text-muted); }
.tl-step.running .tl-node {
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 0 12px rgba(59,130,246,0.4);
  animation: node-pulse 1.5s infinite;
}
.tl-step.completed .tl-node { border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.1); }
.tl-step.failed .tl-node { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.1); }

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(59,130,246,0.3); }
  50% { box-shadow: 0 0 20px rgba(59,130,246,0.6); }
}

.tl-info { flex: 1; min-width: 0; }

.tl-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-step.running .tl-desc { color: var(--text-primary); }

.tl-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.tl-tool-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168,85,247,0.15);
  color: #a855f7;
  font-weight: 500;
}

.tl-model-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
}

.tl-duration {
  font-variant-numeric: tabular-nums;
}

/* --- Center: Graph + Plan + Result --- */
#agent-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(59,130,246,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168,85,247,0.03) 0%, transparent 50%),
    var(--bg-primary);
}

/* Empty state */
.agent-empty-state {
  text-align: center;
  padding: 40px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.agent-empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #f59e0b, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.agent-empty-state p { color: var(--text-muted); font-size: 14px; max-width: 360px; }

/* Graph (SVG) */
.agent-graph {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.graph-node {
  cursor: pointer;
  transition: filter 0.2s;
}
.graph-node:hover { filter: brightness(1.2); }

.graph-edge { stroke: var(--border); stroke-width: 2; fill: none; }
.graph-edge.active { stroke: #3b82f6; stroke-dasharray: 8 4; animation: dash-flow 1s linear infinite; }
.graph-edge.done { stroke: rgba(34,197,94,0.5); }

@keyframes dash-flow { to { stroke-dashoffset: -12; } }

/* Plan Approval Modal */
.plan-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 10;
  animation: fade-in 0.2s ease;
}

.plan-modal-content {
  width: 90%;
  max-width: 580px;
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.plan-modal-header {
  padding: 20px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.plan-modal-header h3 { font-size: 16px; font-weight: 600; }
.plan-cost-estimate { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.plan-est-value { color: #f59e0b; font-weight: 600; font-size: 14px; }
.plan-est-detail { font-size: 11px; }

.plan-steps-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.plan-step-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  animation: fade-in 0.3s ease;
}
.plan-step-item:last-child { border-bottom: none; }

.plan-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.plan-step-body { flex: 1; }
.plan-step-desc { font-size: 13px; color: var(--text-primary); line-height: 1.5; margin-bottom: 6px; }
.plan-step-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.plan-modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.btn-accent {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}
.btn-accent:hover { box-shadow: 0 4px 20px rgba(59,130,246,0.5); transform: translateY(-1px); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Result panel */
.result-panel {
  width: 90%;
  max-width: 640px;
  animation: slide-up 0.3s ease;
}

@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.result-status-icon { font-size: 24px; }
.result-header h3 { font-size: 16px; font-weight: 600; }

.result-body {
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.result-body.success { border-color: rgba(34,197,94,0.3); }
.result-body.failed { border-color: rgba(239,68,68,0.3); }

.result-body pre {
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

.result-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
}

.result-body p { margin-bottom: 8px; }
.result-body p:last-child { margin-bottom: 0; }

.result-meta {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Right: Inspector Panel --- */
.agent-inspector {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: width 0.25s ease, opacity 0.25s ease;
  overflow: hidden;
}

.agent-inspector.collapsed {
  width: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}

.inspector-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.inspector-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Inspector sections */
.insp-section {
  margin-bottom: 16px;
}

.insp-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.insp-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.insp-field:last-child { border-bottom: none; }
.insp-field-label { color: var(--text-muted); }
.insp-field-value { color: var(--text-primary); font-weight: 500; font-variant-numeric: tabular-nums; }

.insp-result-box {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'JetBrains Mono', monospace;
}

.insp-tool-args {
  background: rgba(168,85,247,0.05);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #c4b5fd;
  white-space: pre-wrap;
}

/* Task list items in sidebar */
.task-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.task-item.active { background: rgba(245,158,11,0.15); color: var(--text-primary); }

.task-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-status {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.planning, .status-dot.awaiting_approval { background: var(--warning); }
.status-dot.running { background: var(--accent); animation: pulse 1.5s infinite; }
.status-dot.completed { background: var(--success); }
.status-dot.failed, .status-dot.cancelled { background: var(--error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar { display: none; }
  .message { max-width: 95%; }
  .settings-card { width: 95%; margin: 10px; }
}
