/* ── Agent List ── */
.agent-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.agent-card { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; transition: background .12s; animation: fadeIn .2s ease-out; }
.agent-card:hover { background: var(--bg-hover); }
.agent-card.available { cursor: default; }
.agent-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.agent-dot.pulse { animation: pulse 2s infinite; }
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.agent-meta, .agent-description { font-size: 9px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-description { white-space: normal; line-height: 1.4; }
.agent-model { font-size: 10px; color: var(--text-muted); }
.agent-badge { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: var(--bg); }
.agent-status { font-size: 8px; padding: 3px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; flex-shrink: 0; }
.agent-status.ready { background: rgba(0,255,136,0.15); color: var(--green); }
.agent-status.streaming { background: rgba(0,255,136,0.15); color: var(--green); animation: pulse 1s infinite; }
.agent-status.processing { background: rgba(255,214,10,0.15); color: #ffd60a; }
.agent-status.failed { background: rgba(255,102,102,0.15); color: var(--red); }
.provider-badge { font-size: 8px; padding: 2px 5px; background: rgba(255,255,255,0.1); border-radius: 3px; font-weight: 400; color: var(--text-muted); }

/* ── Agent Groups ── */
.agent-group { margin-bottom: 16px; }
.group-header { display: flex; align-items: center; gap: 6px; padding: 4px 8px; margin-bottom: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.group-icon { font-size: 12px; }
.group-title { flex: 1; }
.group-count { background: var(--glass); padding: 2px 6px; border-radius: 8px; font-size: 9px; }

/* ── Skill Tags ── */
.skill-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.skill-tag { font-size: 8px; padding: 2px 6px; background: rgba(0,122,255,0.15); color: #007aff; border-radius: 3px; font-weight: 500; }

/* ── Launch Button ── */
.launch-btn { padding: 6px 12px; background: var(--orange); color: #000; border: none; border-radius: 6px; font-size: 10px; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: all 0.15s; }
.launch-btn:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(255,149,0,0.3); }
.not-launchable { font-size: 8px; color: var(--text-muted); padding: 4px 8px; background: rgba(255,255,255,0.05); border-radius: 4px; }

/* ── Task Tree ── */
.task-tree { display: flex; flex-direction: column; gap: 1px; padding: 6px; }
.task-item { display: flex; align-items: flex-start; gap: 6px; padding: 5px 8px; border-radius: 5px; cursor: pointer; transition: background .12s; border-left: 3px solid transparent; animation: slideIn .15s ease-out; }
.task-item:hover { background: var(--bg-hover); }
.task-item.d1 { padding-left: 22px; }
.task-item.d2 { padding-left: 38px; }
.task-status { font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 9px; color: var(--text-muted); display: flex; gap: 6px; margin-top: 1px; }
.task-elapsed { font-size: 9px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.task-item[data-status="complete"] .task-title { color: var(--text-muted); text-decoration: line-through; }
.task-item[data-status="complete"] { animation: completePop .3s ease-out; }
@keyframes completePop { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.task-item[data-status="in-progress"] { background: rgba(59,130,246,.08); border-left-color: #3b82f6 !important; }
.task-item[data-status="in-progress"] .task-status { animation: pulse 1.2s ease-in-out infinite; }
.task-item[data-status="pending"] { opacity: .55; }
.task-item[data-status="waiting"] { opacity: .7; }
.task-item[data-status="failed"] { background: rgba(239,68,68,.08); border-left-color: #ef4444 !important; }

/* ── Task Detail ── */
.task-detail-view { padding: 12px; }
.td-back { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.td-back:hover { color: var(--text); }
.td-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.td-title { font-size: 14px; font-weight: 600; }
.td-status { font-size: 10px; padding: 2px 8px; border-radius: 4px; }
.worklog { display: flex; flex-direction: column; gap: 6px; }
.wl-entry { padding: 8px 10px; background: var(--bg-card); border-radius: 6px; border-left: 3px solid var(--border); }
.wl-entry .wl-head { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-muted); margin-bottom: 3px; }
.wl-entry .wl-msg { font-size: 11px; line-height: 1.5; }

/* ── Ring Buffer ── */
.ring-entries { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.ring-entry { padding: 6px 8px; background: var(--bg-card); border-radius: 5px; border-left: 3px solid var(--border); animation: fadeIn .2s ease-out; }
.ring-entry .re-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.ring-entry .re-agent { font-size: 10px; font-weight: 600; }
.ring-entry .re-time { font-size: 9px; color: var(--text-muted); }
.ring-entry .re-text { font-size: 10px; color: var(--text-dim); line-height: 1.4; }

/* ── Agent Detail Modal ── */
.agent-detail-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal-content { position: relative; background: var(--bg-panel); border: 1px solid var(--glass-b); border-radius: 12px; max-width: 700px; width: 90%; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--glass-b); }
.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-header button { width: 32px; height: 32px; border: none; background: var(--glass); color: var(--text-muted); border-radius: 6px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-header button:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body p { margin: 0 0 12px; line-height: 1.6; font-size: 13px; }

/* ── Settings Tabs ── */
.settings-tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--glass-b); }
.settings-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 12px; padding: 8px 12px; cursor: pointer; transition: all .15s; }
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Settings Panel Form Controls (dark theme) ── */
.settings-panel { color: var(--text); }
.settings-panel .provider-selector { font-size: 12px; }
.settings-panel .provider-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.settings-panel .provider-tab { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 11px; color: var(--text-muted); transition: all .15s; }
.settings-panel .provider-tab:hover { color: var(--text); border-color: var(--accent); }
.settings-panel .provider-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.settings-panel .provider-config label { display: block; margin-bottom: 10px; font-size: 11px; color: var(--text-muted); }
.settings-panel .provider-config input,
.settings-panel .provider-config select { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; color: var(--text); font-size: 12px; margin-top: 4px; outline: none; }
.settings-panel .provider-config input:focus,
.settings-panel .provider-config select:focus { border-color: var(--accent); }
.settings-panel .provider-config input[type="range"] { padding: 0; }
.settings-panel .range-val { font-size: 11px; color: var(--accent); min-width: 30px; text-align: right; }
.settings-panel .provider-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.settings-panel .provider-icon { font-size: 18px; }
.settings-panel .provider-name { font-weight: 600; font-size: 14px; }

/* ── Render UI Widget ── */
.render-ui-widget { display: flex; flex-direction: column; height: 100%; }
.render-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.render-ui-pane { flex: 1; border-left: 1px solid var(--border); min-width: 300px; overflow: auto; }

/* ── WebLLM Progress Bar ── */
.webllm-progress { margin-top: 4px; }
.webllm-progress-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.webllm-progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s; border-radius: 3px; }
.webllm-progress-text { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
