* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--vscode-font-family); background: var(--vscode-editor-background); color: var(--vscode-editor-foreground); display: flex; flex-direction: column; }
.toolbar { display: flex; gap: 4px; padding: 4px; border-bottom: 1px solid var(--vscode-panel-border); }
.toolbar button { background: var(--vscode-button-secondaryBackground); color: var(--vscode-button-secondaryForeground); border: none; padding: 3px 8px; border-radius: 3px; cursor: pointer; font-size: 11px; border-bottom: 2px solid transparent; }
.toolbar button:hover { background: var(--vscode-button-secondaryHoverBackground); }
.toolbar button.active { border-bottom-color: var(--vscode-textLink-foreground); color: var(--vscode-textLink-foreground); }
.messages { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; }
.msg { margin-bottom: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.msg.user { background: var(--vscode-input-background); border: 1px solid var(--vscode-input-border); }
.msg.assistant { background: var(--vscode-textBlockQuote-background); border-left: 3px solid var(--vscode-textLink-foreground); }
.msg.tool { font-size: 11px; color: var(--vscode-descriptionForeground); padding: 3px 8px; }
.msg.tool_call { font-size: 11px; color: var(--vscode-descriptionForeground); padding: 3px 8px; border-left: 2px solid #f4a261; }
.msg.tool_result { font-size: 11px; color: var(--vscode-descriptionForeground); padding: 3px 8px; border-left: 2px solid #3fb950; }
.msg.system { font-size: 11px; color: var(--vscode-descriptionForeground); text-align: center; }
.msg.error { color: var(--vscode-errorForeground); }
.agent-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; margin-right: 4px; color: white; }
.status { font-size: 11px; color: var(--vscode-descriptionForeground); padding: 4px 8px; text-align: center; }
.input-area { display: flex; gap: 4px; padding: 4px; border-top: 1px solid var(--vscode-panel-border); }
.input-area textarea { flex: 1; background: var(--vscode-input-background); color: var(--vscode-input-foreground); border: 1px solid var(--vscode-input-border); border-radius: 4px; padding: 6px; font-family: var(--vscode-font-family); font-size: 13px; resize: none; min-height: 36px; max-height: 120px; }
.input-area button { background: var(--vscode-button-background); color: var(--vscode-button-foreground); border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.approval { background: var(--vscode-inputValidation-warningBackground); border: 1px solid var(--vscode-inputValidation-warningBorder); padding: 8px; border-radius: 6px; margin: 4px 0; }
.approval button { margin: 2px; padding: 3px 10px; border: none; border-radius: 3px; cursor: pointer; font-size: 11px; }
pre { background: var(--vscode-textCodeBlock-background); padding: 8px; border-radius: 4px; overflow-x: auto; font-size: 12px; }
code { font-family: var(--vscode-editor-font-family); }
.diff { font-size: 11px; background: var(--vscode-textCodeBlock-background); padding: 6px; border-radius: 4px; overflow-x: auto; }
.diff-add { color: #3fb950; }
.diff-del { color: #f85149; }
.diff-hunk { color: #58a6ff; }
.diff-ctx { color: var(--vscode-descriptionForeground); }
.thinking { color: var(--vscode-descriptionForeground); font-style: italic; animation: pulse 2s infinite; }
.msg-actions { float: right; display: none; gap: 2px; }
.msg:hover .msg-actions { display: inline-flex; }
.msg-actions button { background: none; border: none; cursor: pointer; font-size: 11px; color: var(--vscode-descriptionForeground); padding: 0 3px; }
.msg-actions button:hover { color: var(--vscode-editor-foreground); }
.reply-bar { background: var(--vscode-textBlockQuote-background); border-top: 1px solid var(--vscode-panel-border); padding: 4px 12px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--vscode-descriptionForeground); }
.reply-bar .reply-close { cursor: pointer; margin-left: auto; color: var(--vscode-errorForeground); font-size: 14px; background: none; border: none; }
.reply-quote { font-size: 10px; color: var(--vscode-descriptionForeground); border-left: 2px solid var(--vscode-textLink-foreground); padding: 2px 6px; margin-bottom: 4px; cursor: pointer; }
.reply-quote:hover { background: var(--vscode-list-hoverBackground); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.load-more { text-align: center; padding: 8px; color: var(--vscode-textLink-foreground); cursor: pointer; font-size: 12px; }
.load-more:hover { text-decoration: underline; }
.token-footer { font-size: 10px; color: var(--vscode-descriptionForeground); margin-top: 4px; }
.toolbar-row2 { display: flex; gap: 3px; padding: 2px 4px; border-bottom: 1px solid var(--vscode-panel-border); flex-wrap: wrap; }
.toolbar-row2 button { background: none; color: var(--vscode-descriptionForeground); border: none; padding: 2px 6px; cursor: pointer; font-size: 10px; border-radius: 3px; }
.toolbar-row2 button:hover { background: var(--vscode-button-secondaryHoverBackground); color: var(--vscode-editor-foreground); }
.toolbar-row2 .active { color: var(--vscode-textLink-foreground); }
.relay-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; margin-left: auto; cursor: pointer; }
.ctx-menu { background: var(--vscode-menu-background, var(--vscode-editor-background)); border: 1px solid var(--vscode-menu-border, var(--vscode-panel-border)); border-radius: 4px; padding: 2px 0; z-index: 1000; min-width: 140px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.ctx-menu-item { padding: 4px 12px; cursor: pointer; font-size: 12px; color: var(--vscode-menu-foreground, var(--vscode-editor-foreground)); }
.ctx-menu-item:hover { background: var(--vscode-menu-selectionBackground, var(--vscode-list-hoverBackground)); color: var(--vscode-menu-selectionForeground, var(--vscode-editor-foreground)); }
.relay-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.relay-dot.on { background: #3fb950; }
.relay-dot.off { background: #f85149; }
.panel-overlay { display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--vscode-editor-background); z-index: 10; overflow-y: auto; padding: 8px; }
.panel-overlay.visible { display: block; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel-header h4 { margin: 0; font-size: 13px; }
.panel-close { background: none; border: none; color: var(--vscode-descriptionForeground); cursor: pointer; font-size: 16px; }
.panel-item { padding: 4px 6px; font-size: 11px; border-bottom: 1px solid var(--vscode-panel-border); cursor: context-menu; }
.panel-item:hover { background: var(--vscode-list-hoverBackground); }
.res-section { padding: 6px; cursor: pointer; font-size: 12px; user-select: none; border-bottom: 1px solid var(--vscode-panel-border); }
.res-section:hover { background: var(--vscode-list-hoverBackground); }
.res-arrow { font-size: 10px; transition: transform 0.2s; display: inline-block; }
.res-section.collapsed .res-arrow { transform: rotate(-90deg); }
.res-section.collapsed + .res-items { display: none; }
.res-items { }
.res-ctx { position: fixed; z-index: 100; background: var(--vscode-menu-background); border: 1px solid var(--vscode-menu-border); border-radius: 4px; padding: 2px 0; min-width: 140px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.res-ctx div { padding: 4px 12px; font-size: 11px; cursor: pointer; color: var(--vscode-menu-foreground); }
.res-ctx div:hover { background: var(--vscode-menu-selectionBackground); color: var(--vscode-menu-selectionForeground); }
.res-ctx hr { border: none; border-top: 1px solid var(--vscode-menu-separatorBackground); margin: 2px 0; }
.sub-trace { border-left: 2px solid #f4a261; margin: 4px 0; border-radius: 4px; font-size: 11px; }
.sub-trace-header { padding: 4px 8px; cursor: pointer; color: var(--vscode-descriptionForeground); display: flex; align-items: center; gap: 4px; }
.sub-trace-header:hover { background: var(--vscode-list-hoverBackground); }
.sub-trace-body { display: none; padding: 2px 8px 4px 16px; color: var(--vscode-descriptionForeground); font-size: 10px; }
.sub-trace-body.open { display: block; }
.trace-entry { padding: 1px 0; }
.trace-entry.tool { color: #f4a261; }
.trace-entry.done { color: #3fb950; }
.trace-content { margin-top: 4px; padding: 4px; background: var(--vscode-textBlockQuote-background); border-radius: 3px; white-space: pre-wrap; font-size: 11px; color: var(--vscode-editor-foreground); }
