/* === Intelligence Panel (Right) === */
.intel-panel {
  width: var(--intel-width); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-glass-heavy); backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-left: 1px solid var(--border);
  transition: width var(--duration-slow) var(--ease-out), opacity var(--duration-normal);
  overflow: hidden; position: relative;
}
.intel-panel.collapsed { width: 0; border-left: none; opacity: 0; }

/* Resize handle */
.intel-resize {
  position: absolute; left: -3px; top: 0; bottom: 0; width: 6px;
  cursor: col-resize; z-index: 5; transition: background var(--duration-fast);
}
.intel-resize:hover, .intel-resize.active { background: var(--accent); opacity: 0.4; }

.intel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-3) 0 var(--space-1); height: 38px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.intel-tabs { display: flex; gap: 2px; }
.intel-tab {
  padding: var(--space-2) var(--space-4); border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-size: 11px;
  font-family: inherit; font-weight: 500; cursor: pointer;
  transition: all var(--duration-fast); display: flex; align-items: center; gap: 5px;
}
.intel-tab:hover { background: var(--bg-hover); color: var(--text-secondary); }
.intel-tab.active { background: var(--accent-dim); color: var(--accent); }
.intel-tab-icon { font-size: 12px; }
.intel-actions { display: flex; gap: 2px; }

.intel-context {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4);
  background: var(--accent-dim); border-bottom: 1px solid var(--accent-dim);
  font-size: 11px; color: var(--accent); flex-shrink: 0; min-height: 0;
}
.intel-context-icon { font-size: 12px; flex-shrink: 0; }
.intel-context-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.intel-context-close {
  width: 18px; height: 18px; border: none; border-radius: 4px;
  background: transparent; color: var(--text-muted); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--duration-fast); line-height: 1;
}
.intel-context-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.intel-body { flex: 1; display: none; flex-direction: column; overflow: hidden; min-height: 0; }
.intel-body.active { display: flex; }

/* Terminal in intel panel */
#terminal { flex: 1; overflow: hidden; }
.xterm { height: 100%; }
#mobile-toolbar {
  display: none; background: var(--bg-glass-heavy); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-3); gap: 5px; flex-wrap: wrap; justify-content: center; flex-shrink: 0;
}
#mobile-toolbar button {
  padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-hover); color: var(--text-muted); font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; cursor: pointer; min-width: 42px;
  touch-action: manipulation; transition: all var(--duration-fast);
}
#mobile-toolbar button:active { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }

/* Voice in intel panel */
.voice-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--space-6) var(--space-5); gap: 0; text-align: center;
  overflow: hidden; position: relative;
}
.voice-body::before {
  content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,0.07) 0%, rgba(99,102,241,0.03) 40%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -55%); pointer-events: none;
  transition: opacity 0.4s;
}
.voice-body h2 { font-size: 1.3rem; font-weight: 300; color: var(--text-primary); letter-spacing: 0.01em; margin-bottom: 4px; }
.voice-body .voice-subtitle { font-size: 0.78rem; color: var(--text-muted); max-width: 240px; line-height: 1.5; margin-bottom: 20px; }
#voice-status { font-size: 12px; font-weight: 400; color: var(--text-muted); min-height: 18px; flex-shrink: 0; letter-spacing: 0.02em; margin-bottom: 6px; }

#mic-btn {
  width: 80px; height: 80px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 40%, #a78bfa 100%);
  color: rgba(255,255,255,0.9); cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.25), 0 0 60px rgba(129, 140, 248, 0.1);
  position: relative; z-index: 1;
}
#mic-btn svg { width: 28px; height: 28px; }
#mic-btn:hover { transform: scale(1.05); box-shadow: 0 4px 40px rgba(99,102,241,0.35), 0 0 80px rgba(129,140,248,0.15); }
#mic-btn:active { transform: scale(0.97); }
#mic-btn.active { animation: orb-breathe 3s ease-in-out infinite; box-shadow: 0 4px 40px rgba(99,102,241,0.4), 0 0 80px rgba(129,140,248,0.2); }
#mic-btn.muted { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); box-shadow: none; animation: none; }
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 40px rgba(99,102,241,0.4), 0 0 80px rgba(129,140,248,0.2); }
  50% { transform: scale(1.06); box-shadow: 0 4px 50px rgba(99,102,241,0.5), 0 0 100px rgba(129,140,248,0.25); }
}
.mic-label { font-size: 11px; color: var(--text-muted); margin-top: 10px; min-height: 16px; letter-spacing: 0.03em; }
#voice-end-btn {
  padding: var(--space-2) var(--space-5); background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-xl); color: var(--text-muted); font-size: 11px;
  cursor: pointer; font-family: inherit; transition: all var(--duration-normal); display: none; margin-top: 4px;
}
#voice-end-btn:hover { background: var(--red-dim); color: var(--red); }

.voice-presets { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; max-width: 380px; margin-top: var(--space-5); }
.voice-preset {
  padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-hover); color: var(--text-secondary); cursor: pointer;
  font-size: 11px; font-family: inherit; font-weight: 500; transition: all var(--duration-normal); text-align: left;
}
.voice-preset:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--text-primary); }
.voice-preset-label { font-weight: 600; }

.voice-settings { display: flex; gap: var(--space-4); align-items: center; justify-content: center; margin-top: var(--space-5); opacity: 0.5; transition: opacity var(--duration-normal); flex-wrap: wrap; }
.voice-settings:hover { opacity: 1; }
.voice-setting { display: flex; align-items: center; gap: var(--space-1); }
.voice-setting label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
#voice-select {
  background: var(--bg-primary); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-3); font-size: 10px; font-family: inherit; outline: none;
  cursor: pointer; transition: all var(--duration-fast); max-width: 140px;
}
#voice-select:focus { border-color: var(--border-focus); color: var(--text-primary); }

/* Speed pills — discrete TTS playback rates, picked before starting a session. */
.voice-speed-pills { display: flex; gap: 2px; flex-wrap: wrap; }
.speed-pill {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: transparent;
  font-family: inherit; font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}
.speed-pill:hover { border-color: var(--accent); color: var(--text-secondary); }
.speed-pill.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(129,140,248,0.25); }

/* Plan progress strip — minimal "1 / 3 ● ○ ○ · topic" indicator */
.voice-plan-outline {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 4px var(--space-3);
  margin: 0;
  font-size: 10px;
  color: var(--text-muted);
  min-height: 18px;
}
.voice-plan-outline.visible { display: flex; }
.plan-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 28px;
}
.plan-dots {
  display: flex; gap: 4px; align-items: center; flex-shrink: 0;
}
.plan-dot {
  width: 8px; height: 8px;
  padding: 0; border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.plan-dot:hover { border-color: var(--accent); transform: scale(1.15); }
.plan-dot.done { background: var(--text-muted); border-color: transparent; opacity: 0.55; }
.plan-dot.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px var(--accent); transform: scale(1.15); }
.plan-current {
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}

/* Gesture buttons — discoverable affordances during an active session */
.voice-gestures {
  display: none;
  gap: var(--space-2);
  justify-content: center;
  align-items: center;
  margin: var(--space-2) 0 var(--space-1);
  flex-wrap: wrap;
}
.intel-body.session-active .voice-gestures { display: flex; }
.voice-gesture {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: transparent; color: var(--text-secondary);
  font-size: 11px; font-family: inherit; cursor: pointer;
  transition: all var(--duration-fast);
}
.voice-gesture:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.voice-gesture:active, .voice-gesture.voice-gesture-fired { transform: scale(0.94); border-color: var(--accent); color: var(--accent); }
.voice-gesture svg { opacity: 0.85; }

/* Toast for gesture acknowledgement (save confirmation, etc.) */
.voice-gesture-toast {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 5px var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal), transform var(--duration-normal);
  z-index: 20;
}
.voice-gesture-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.voice-gesture-toast-ok { border-color: var(--accent); color: var(--accent); }
.voice-gesture-toast-err { border-color: var(--amber); color: var(--amber); }

/* Voice session states */
.intel-body.session-active .voice-body { justify-content: flex-start; padding-top: var(--space-4); gap: var(--space-2); }
.intel-body.session-active .voice-body::before { opacity: 0; }
.intel-body.session-active .voice-body h2,
.intel-body.session-active .voice-subtitle { display: none; }
.intel-body.session-active #voice-end-btn { display: inline-flex; }
.intel-body.session-active #mic-btn { width: 56px; height: 56px; }
.intel-body.session-active #mic-btn svg { width: 22px; height: 22px; }
.intel-body.session-active .mic-label { display: none; }
.intel-body.session-active .voice-presets,
.intel-body.session-active .voice-settings { display: none; }

.intel-body.session-ended .voice-body { justify-content: flex-start; padding-top: 0; gap: 0; }
.intel-body.session-ended .voice-body::before { display: none; }
.intel-body.session-ended .voice-body h2,
.intel-body.session-ended .voice-subtitle,
.intel-body.session-ended .voice-settings,
.intel-body.session-ended .voice-presets,
.intel-body.session-ended #mic-btn,
.intel-body.session-ended .mic-label,
.intel-body.session-ended #voice-end-btn,
.intel-body.session-ended #voice-status { display: none; }
.intel-body.session-ended #transcript { flex: 1; padding-top: 0; }

.voice-ended-bar {
  display: none; width: 100%; padding: var(--space-4);
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; justify-content: center;
}
.intel-body.session-ended .voice-ended-bar { display: flex; }
.voice-ended-bar-inner { display: flex; align-items: center; justify-content: center; gap: var(--space-2); flex-wrap: wrap; }
.voice-ended-actions { display: flex; gap: var(--space-2); }
.btn-new-session { padding: 7px var(--space-5); background: var(--accent); color: #fff; border: none; border-radius: var(--radius-xl); font-size: 12px; font-weight: 500; font-family: inherit; cursor: pointer; transition: all var(--duration-fast); }
.btn-new-session:hover { background: var(--accent-hover); }
.btn-resume-session { padding: 7px var(--space-5); background: transparent; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); font-size: 12px; font-family: inherit; cursor: pointer; transition: all var(--duration-fast); }
.btn-resume-session:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-save-conv { padding: 7px var(--space-4); background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-xl); font-size: 12px; font-family: inherit; cursor: pointer; transition: all var(--duration-fast); display: flex; align-items: center; gap: var(--space-1); }
.btn-save-conv:hover { background: var(--green-dim); color: var(--green); }
.btn-save-conv.saved { color: var(--green); pointer-events: none; }

/* Transcript */
#transcript { flex: 1; width: 100%; overflow-y: auto; padding: var(--space-1) 0; min-height: 0; }
.transcript-entry { padding: var(--space-2) var(--space-4); margin: 3px var(--space-1); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.5; max-width: 92%; transition: opacity var(--duration-fast); }
.transcript-user { background: var(--accent-dim); color: var(--text-primary); margin-left: auto; border-bottom-right-radius: 3px; }
.transcript-agent { background: var(--bg-elevated); color: var(--text-primary); margin-right: auto; border-bottom-left-radius: 3px; }
/* Interim (streaming STT, not yet finalized) — slightly dimmed so the user knows it's in progress */
.transcript-interim { opacity: 0.65; }
/* Karaoke: each word fades in as the TTS reaches it */
.transcript-word { opacity: 0.42; transition: opacity 0.18s ease, color 0.18s ease; }
.transcript-word.spoken { opacity: 1; }

/* Quote card — source attribution for a section the planner curated from a note */
.voice-quote-card {
  margin: var(--space-2) var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--accent);
  background: var(--bg-elevated);
  border-radius: 3px;
  max-width: 92%;
  font-size: 11px;
  line-height: 1.45;
  animation: voice-quote-in 220ms ease;
}
.voice-quote-text {
  color: var(--text-secondary);
  font-style: italic;
}
.voice-quote-text::before { content: "\201C"; margin-right: 1px; }
.voice-quote-text::after  { content: "\201D"; margin-left: 1px; }
.voice-quote-source {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: var(--space-1);
  padding: 2px var(--space-2);
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text-muted); font-size: 10px; font-family: var(--font-mono);
  cursor: pointer; transition: all var(--duration-fast);
}
.voice-quote-source:hover { border-color: var(--accent); color: var(--accent); }
.voice-quote-source svg { opacity: 0.7; }
.voice-quote-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
@keyframes voice-quote-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.transcript-link { color: var(--accent-text); cursor: pointer; text-decoration: none; border-bottom: 1px dashed var(--accent-dim); transition: border-color var(--duration-fast); }
.transcript-link:hover { border-bottom-color: var(--accent); border-bottom-style: solid; }

.tool-card { margin: var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface); font-size: 10px; font-family: var(--font-mono); overflow: hidden; }
.tool-card-header { display: flex; align-items: center; padding: var(--space-2) var(--space-3); background: var(--bg-elevated); cursor: pointer; gap: var(--space-2); transition: background var(--duration-fast); }
.tool-card-header:hover { background: var(--bg-hover); }
.tool-name { color: var(--amber); font-weight: 600; white-space: nowrap; }
.tool-name::before { content: "fn "; color: var(--text-muted); font-weight: 400; }
.tool-args { color: var(--text-muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tool-duration { color: var(--green); font-size: 9px; white-space: nowrap; font-weight: 500; }
.tool-toggle { color: var(--text-muted); font-size: 9px; width: 12px; text-align: center; }
.tool-card-body { display: none; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); max-height: 200px; overflow-y: auto; }
.tool-card-body.open { display: block; }
.tool-section { margin-bottom: var(--space-2); }
.tool-section-label { font-size: 8px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.tool-section-content { color: var(--text-secondary); white-space: pre-wrap; word-break: break-all; font-size: 9px; line-height: 1.4; }
.tool-files { list-style: none; padding: 0; }
.tool-files li { padding: 2px 0; color: var(--green); font-size: 10px; }
.tool-files li .file-snippet { color: var(--text-muted); display: block; font-size: 9px; margin: 1px 0 3px 10px; white-space: pre-wrap; border-left: 2px solid var(--border); padding-left: var(--space-2); }

/* --- Task Board --- */
.tasks-controls { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); gap: var(--space-2); }
.tasks-controls-left { display: flex; gap: var(--space-2); align-items: center; }
.tasks-controls-right { display: flex; align-items: center; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.auto-execute-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; color: var(--text-secondary); }
.auto-execute-toggle input { display: none; }
.toggle-slider { width: 28px; height: 16px; background: var(--bg-glass-heavy); border-radius: 8px; position: relative; transition: background var(--duration-fast) var(--ease-out); }
.toggle-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--text-muted); border-radius: 50%; transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast); }
.auto-execute-toggle input:checked + .toggle-slider { background: var(--accent); }
.auto-execute-toggle input:checked + .toggle-slider::after { transform: translateX(12px); background: var(--bg-primary); }

.task-add-form { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.task-add-form textarea { width: 100%; background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2); font-size: 12px; font-family: var(--font-mono); resize: vertical; outline: none; }
.task-add-form textarea:focus { border-color: var(--accent); }
.task-add-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }

.tasks-body { flex: 1; overflow-y: auto; padding: var(--space-2) 0; }
.tasks-section { margin-bottom: var(--space-2); }
.tasks-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: var(--space-1) var(--space-3); }

.task-card { margin: 0 var(--space-2); padding: var(--space-2) var(--space-3); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--space-1); cursor: pointer; transition: border-color var(--duration-fast); }
.task-card:hover { border-color: var(--accent-dim); }
.task-card.running { border-left: 3px solid var(--accent); }
.task-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.task-card-prompt { font-size: 12px; color: var(--text-primary); line-height: 1.4; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-card-chevron { color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }
.task-card-meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); font-size: 10px; color: var(--text-muted); flex-wrap: wrap; }
.task-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.task-card-actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: var(--radius-sm); }
.task-card-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }

.task-source-badge { font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.task-source-badge.voice { background: var(--accent-dim); color: var(--accent-text); }
.task-source-badge.cron { background: rgba(245,166,35,0.15); color: var(--amber); }
.task-source-badge.manual { background: var(--bg-glass-heavy); color: var(--text-secondary); }

.task-state-badge { font-size: 9px; font-weight: 500; }
.task-state-badge.completed { color: var(--green); }
.task-state-badge.failed { color: var(--red); }
.task-state-badge.cancelled { color: var(--text-muted); }

.task-running-output { margin-top: var(--space-2); background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2); max-height: 300px; overflow-y: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-all; line-height: 1.4; }
.task-running-spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--accent-dim); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 6px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.task-output-toggle { font-size: 10px; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; margin-top: var(--space-1); }
.task-output-toggle:hover { text-decoration: underline; }
.task-output-collapsed { display: none; margin-top: var(--space-1); background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2); max-height: 200px; overflow-y: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); white-space: pre-wrap; word-break: break-all; }
.task-output-collapsed.open { display: block; }

/* Cron job cards */
.cron-card { margin: 0 var(--space-2); padding: var(--space-2) var(--space-3); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--space-1); display: flex; align-items: center; gap: var(--space-2); }
.cron-card-info { flex: 1; min-width: 0; }
.cron-card-name { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.cron-card-schedule { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.cron-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.cron-card-actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: var(--radius-sm); }
.cron-card-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }
.cron-enabled-toggle { width: 28px; height: 16px; background: var(--bg-glass-heavy); border-radius: 8px; position: relative; cursor: pointer; border: none; flex-shrink: 0; transition: background var(--duration-fast); }
.cron-enabled-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--text-muted); border-radius: 50%; transition: transform var(--duration-fast), background var(--duration-fast); }
.cron-enabled-toggle.on { background: var(--accent); }
.cron-enabled-toggle.on::after { transform: translateX(12px); background: var(--bg-primary); }

/* Task tab badge */
.task-badge { background: var(--accent); color: var(--bg-primary); font-size: 9px; font-weight: 700; min-width: 14px; height: 14px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; padding: 0 4px; }

/* Model badges */
.task-model-badge { font-size: 9px; font-weight: 500; padding: 1px 5px; border-radius: 6px; background: var(--bg-glass-heavy); color: var(--text-secondary); text-transform: capitalize; }

/* Task detail view */
.task-detail { padding: var(--space-2) var(--space-3); }
.task-detail-back { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--accent); cursor: pointer; padding: var(--space-1) 0; margin-bottom: var(--space-2); }
.task-detail-back:hover { text-decoration: underline; }
.task-detail-header { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.task-detail-state { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.task-detail-state.running { color: var(--accent); }
.task-detail-state.pending { color: var(--text-secondary); }
.task-detail-state.completed { color: var(--green); }
.task-detail-state.failed { color: var(--red); }
.task-detail-state.cancelled { color: var(--text-muted); }

.task-detail-section { margin-bottom: var(--space-3); }
.task-detail-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: var(--space-1); }

.task-detail-prompt-edit { width: 100%; background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2); font-size: 12px; font-family: var(--font-sans); line-height: 1.5; resize: vertical; outline: none; }
.task-detail-prompt-edit:focus { border-color: var(--accent); }
.task-detail-prompt-ro { font-size: 12px; color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2); }

.task-detail-models { display: flex; gap: var(--space-1); }
.model-chip { padding: 4px 12px; font-size: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; transition: all var(--duration-fast); }
.model-chip:hover { border-color: var(--accent-dim); color: var(--text-primary); }
.model-chip.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

.task-detail-meta { font-size: 10px; color: var(--text-muted); margin-bottom: var(--space-3); line-height: 1.8; }
.task-detail-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); margin-bottom: var(--space-3); }

.task-detail-output { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); word-break: break-word; line-height: 1.5; max-height: 500px; overflow-y: auto; margin: 0; }
.task-detail-output.live { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim); }

/* Stream-json activity log entries */
.task-log-tool { padding: 3px 0; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 11px; }
.task-log-tool-name { color: var(--accent); font-weight: 600; margin-right: 6px; }
.task-log-text { padding: 4px 0; color: var(--text-primary); white-space: pre-wrap; font-size: 12px; font-family: var(--font-sans); line-height: 1.5; }
.task-log-result { padding: 6px 0; color: var(--green); white-space: pre-wrap; font-size: 12px; font-family: var(--font-sans); line-height: 1.5; border-top: 1px solid var(--border); margin-top: 4px; }
.task-log-raw { padding: 2px 0; color: var(--text-muted); white-space: pre-wrap; font-size: 10px; }

/* Empty state */
.tasks-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-8) var(--space-4); color: var(--text-muted); text-align: center; }
.tasks-empty-icon { font-size: 36px; opacity: 0.3; margin-bottom: var(--space-2); }
.tasks-empty h3 { font-size: 14px; color: var(--text-secondary); margin: 0 0 var(--space-1); }
.tasks-empty p { font-size: 11px; margin: 0; }
