/* =====================================================
   SwiftAgent Workspace — Phase 3.2 Evidence Chips & Visual Polish
   Stable layout, no-jank updates, blue-violet science theme
   ===================================================== */

/* ═══════════ MODULE ACCENT ═══════════ */
body.module-agent {
  --module-accent: #2563EB;
  --module-accent-2: #8B5CF6;
  --module-accent-3: #38BDF8;
  --module-soft: rgba(99, 102, 241, 0.10);
  --module-glow: rgba(99, 102, 241, 0.22);
  --agent-blue: #2563EB;
  --agent-violet: #8B5CF6;
  --agent-teal: #14B8A6;
  --agent-amber: #F59E0B;
  --agent-red: #EF4444;
  --agent-green: #10B981;
  --agent-cyan: #06B6D4;
  --step-pending: #94A3B8;
  --step-running: #4F46E5;
  --step-completed: #0F766E;
  --step-partial: #B45309;
  --step-failed: #BE123C;
  --step-interrupted: #475569;
  --step-skipped: #CBD5E1;
  background: linear-gradient(180deg, #EEF6FF 0%, #F2F8FF 40%, #F8FBFF 100%);
  min-height: 100vh;
}

/* ═══════════ SCROLLBAR ═══════════ */
.panel-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.22) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.22); border-radius: 999px; }

/* ═══════════ PAGE LAYOUT ═══════════ */
.agent-page {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 28px 60px;
  position: relative;
}
.agent-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(37,99,235,0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Hero */
.agent-hero-section {
  position: relative; z-index: 1; overflow: hidden;
  margin-bottom: 22px;
  padding: 26px 32px; min-height: 200px;
  background:
    radial-gradient(circle at 78% 26%, rgba(139, 92, 246, 0.14), transparent 34%),
    radial-gradient(circle at 18% 78%, rgba(56, 189, 248, 0.11), transparent 36%),
    radial-gradient(circle at 55% 50%, rgba(99, 102, 241, 0.05), transparent 50%),
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(239,246,255,0.74));
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(99, 102, 241, 0.12);
  border-radius: 28px;
  box-shadow: 0 26px 80px rgba(37, 99, 235, 0.10), inset 0 1px 0 rgba(255,255,255,0.8);
}
/* Readability shield: left-to-right white gradient */
.agent-hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.90) 0%,
    rgba(255,255,255,0.76) 38%,
    rgba(255,255,255,0.20) 72%,
    rgba(255,255,255,0.05) 100%);
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}
/* Remove old ::after gradient bubbles */
.agent-hero-section::after { display: none; }

/* ─── Hero Visual Layer ─── */
.agent-hero-visual {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
}

/* Protein ribbon SVG */
.bio-ribbon-bg {
  position: absolute;
  right: 3%; top: 50%;
  width: 520px; height: 260px;
  transform: translateY(-50%);
  opacity: 0.18;
  filter: blur(0.3px);
  animation: ribbonBreathe 10s ease-in-out infinite;
}

/* Ghost evidence cards */
.ghost-card {
  position: absolute;
  padding: 7px 13px;
  border-radius: 14px;
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(99,102,241,0.13);
  box-shadow: 0 10px 30px rgba(37,99,235,0.06);
  color: rgba(30,58,138,0.52);
  font-size: 0.72rem; font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.gc-uniprot {
  right: 18%; top: 16%;
  animation: ghostFloat 8s ease-in-out infinite;
}
.gc-rcsb {
  right: 6%; top: 38%;
  animation: ghostFloat 9s ease-in-out 1s infinite;
}
.gc-pubmed {
  right: 22%; bottom: 18%;
  animation: ghostFloat 7s ease-in-out 0.5s infinite;
}
.gc-alphafold {
  right: 38%; top: 22%;
  animation: ghostFloat 10s ease-in-out 2s infinite;
}

/* Pipeline orbit nodes */
.pipeline-orbit {
  position: absolute;
  right: 42%; bottom: 22%;
  display: flex; gap: 6px;
}
.orbit-node {
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(79,70,229,0.06);
  border: 1px solid rgba(99,102,241,0.10);
  color: rgba(79,70,229,0.44);
  font-size: 0.62rem; font-weight: 600;
  white-space: nowrap;
}
.orbit-node.on-1 { animation: ghostFloat 11s ease-in-out 0s infinite; }
.orbit-node.on-2 { animation: ghostFloat 11s ease-in-out 0.6s infinite; }
.orbit-node.on-3 { animation: ghostFloat 11s ease-in-out 1.2s infinite; }
.orbit-node.on-4 { animation: ghostFloat 11s ease-in-out 1.8s infinite; }
.orbit-node.on-5 { animation: ghostFloat 11s ease-in-out 2.4s infinite; }

/* Molecular bubbles */
.mol-bubble {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, rgba(99,102,241,0.02) 70%);
  filter: blur(1px);
}
.mb-1 {
  width: 60px; height: 60px;
  right: 12%; top: 10%;
  animation: bubbleFloat 9s ease-in-out infinite;
}
.mb-2 {
  width: 40px; height: 40px;
  right: 34%; bottom: 12%;
  animation: bubbleFloat 7s ease-in-out 1.5s infinite;
}
.mb-3 {
  width: 28px; height: 28px;
  right: 50%; top: 30%;
  animation: bubbleFloat 11s ease-in-out 3s infinite;
}

/* ─── Hero Content ─── */
.agent-hero-content {
  position: relative; z-index: 2;
}
.agent-hero-section h1 {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, #1e40af, #2563eb, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin: 0 0 6px;
}
.agent-hero-section .agent-subtitle {
  font-size: 0.86rem; color: #64748B; margin: 0 0 12px; line-height: 1.6;
  max-width: 560px;
}
.agent-hero-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.76rem; color: #475569; font-weight: 500;
}
.agent-hero-status .module-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #14B8A6);
  box-shadow: 0 0 6px rgba(16,185,129,0.4);
}

/* ═══════════ THREE-PANEL GRID ═══════════ */
.agent-workbench-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 360px 1fr 340px;
  gap: 18px;
  align-items: stretch;
}
.agent-panel {
  background: rgba(255,255,255,0.76);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1.5px solid rgba(37,99,235,0.10);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(37,99,235,0.06);
  padding: 20px;
  transition: box-shadow 0.3s;
  height: calc(100vh - 360px); min-height: 620px; max-height: 760px;
  display: flex; flex-direction: column;
}
.agent-panel:hover { box-shadow: 0 16px 48px rgba(37,99,235,0.09); }
.agent-panel-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  background: linear-gradient(135deg, #1e40af, #6366F1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(99,102,241,0.10);
}

/* Left + right panels scroll */
.task-input-panel, .result-evidence-panel {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.18) transparent;
}
.task-input-panel::-webkit-scrollbar, .result-evidence-panel::-webkit-scrollbar { width: 5px; }
.task-input-panel::-webkit-scrollbar-thumb, .result-evidence-panel::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.18); border-radius: 999px;
}

/* Center panel: no scroll — internal regions scroll */
.timeline-panel { overflow: hidden; }

/* ═══════════ LEFT: TASK INPUT ═══════════ */
.task-input-panel .task-textarea {
  width: 100%; min-height: 90px; max-height: 180px;
  padding: 14px 16px; border: 1.5px solid rgba(37,99,235,0.12); border-radius: 14px;
  font-size: 0.86rem; line-height: 1.6; color: #1e293b;
  background: rgba(255,255,255,0.9); resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s; font-family: inherit;
  box-shadow: 0 3px 12px rgba(37,99,235,0.04);
}
.task-input-panel .task-textarea:focus {
  outline: none; border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.10), 0 6px 20px rgba(37,99,235,0.06);
}
.task-input-panel .task-textarea::placeholder { color: #94A3B8; }

.mode-selector {
  display: flex; margin: 12px 0; border-radius: 12px; overflow: hidden;
  border: 1.5px solid rgba(99,102,241,0.12); background: rgba(255,255,255,0.5);
}
.mode-btn {
  flex: 1; padding: 8px 10px; font-size: 0.76rem; font-weight: 600;
  border: none; background: transparent; color: #64748B; cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.mode-btn.active {
  background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.mode-btn:not(.active):hover { background: rgba(79,70,229,0.06); color: #4F46E5; }

.example-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.example-chip {
  font-size: 0.72rem; padding: 5px 12px; border-radius: 16px;
  background: rgba(255,255,255,0.8); color: #475569;
  border: 1px solid rgba(99,102,241,0.10); cursor: pointer;
  transition: all 0.2s; box-shadow: 0 1px 4px rgba(37,99,235,0.03);
}
.example-chip:hover {
  border-color: #4F46E5; background: rgba(79,70,229,0.05); color: #3730a3;
  box-shadow: 0 3px 10px rgba(79,70,229,0.08); transform: translateY(-1px);
}

/* Example prompts dropdown */
.example-prompts-section { margin: 12px 0; }
.example-prompts-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 0.74rem; color: #6366F1; font-weight: 500;
  padding: 6px 10px; border-radius: 8px;
  transition: background 0.2s;
}
.example-prompts-toggle:hover { background: rgba(99,102,241,0.06); }
.example-prompts-toggle .example-toggle-icon { margin-left: auto; font-size: 0.6rem; transition: transform 0.2s; }
.example-prompts-toggle.is-open .example-toggle-icon { transform: rotate(180deg); }
.example-prompts-list {
  margin-top: 6px; border-radius: 10px;
  background: rgba(248,251,255,0.9); border: 1px solid rgba(99,102,241,0.08);
  overflow: hidden;
}
.example-prompt-item {
  padding: 10px 14px; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid rgba(99,102,241,0.05);
}
.example-prompt-item:last-child { border-bottom: none; }
.example-prompt-item:hover { background: rgba(99,102,241,0.05); }
.example-prompt-title { font-size: 0.74rem; font-weight: 600; color: #334155; }
.example-prompt-desc { font-size: 0.66rem; color: #64748B; margin-top: 2px; }

.task-actions { display: flex; gap: 10px; margin-top: 14px; }
.agent-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 0.8rem; font-weight: 600;
  border: none; border-radius: 12px; cursor: pointer;
  transition: all 0.2s;
}
.agent-btn:active { transform: scale(0.97); }
.agent-btn-primary {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); color: #fff;
  box-shadow: 0 5px 18px rgba(79,70,229,0.3);
}
.agent-btn-primary:hover { box-shadow: 0 7px 24px rgba(79,70,229,0.4); transform: translateY(-1px); }
.agent-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
.agent-btn-secondary {
  background: rgba(255,255,255,0.8); color: #4F46E5;
  border: 1.5px solid rgba(79,70,229,0.16); box-shadow: 0 2px 6px rgba(79,70,229,0.05);
}
.agent-btn-secondary:hover { background: rgba(79,70,229,0.05); border-color: rgba(79,70,229,0.28); }

/* Intent card */
.intent-result-card {
  margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.85); border: 1px solid rgba(99,102,241,0.10);
  box-shadow: 0 3px 12px rgba(79,70,229,0.04); animation: fadeSlideIn 0.3s ease;
}
.intent-result-card .intent-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 6px;
}
.intent-result-card .intent-value { font-size: 0.82rem; color: #334155; line-height: 1.5; }
.intent-result-card .intent-missing {
  margin-top: 8px; padding: 9px 12px;
  background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.18);
  border-radius: 10px; font-size: 0.76rem; color: #92400E; line-height: 1.5;
}

/* Advanced */
.agent-advanced-toggle {
  font-size: 0.74rem; color: #64748B; cursor: pointer; margin-top: 10px;
  padding: 5px 0; border: none; background: none; display: flex; align-items: center; gap: 5px;
}
.agent-advanced-panel { display: none; margin-top: 10px; padding: 12px; background: rgba(248,251,255,0.9); border-radius: 12px; border: 1px solid rgba(99,102,241,0.08); }
.agent-advanced-panel.open { display: block; }
.agent-advanced-panel .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.agent-advanced-panel .form-group label { font-size: 0.7rem; color: #64748B; display: block; margin-bottom: 3px; }
.agent-advanced-panel input, .agent-advanced-panel select {
  width: 100%; padding: 6px 9px; font-size: 0.76rem;
  border: 1.5px solid rgba(99,102,241,0.12); border-radius: 8px; background: #fff; color: #334155;
}

/* Recent tasks */
.recent-tasks-section { margin-top: 18px; }
.recent-task-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin-bottom: 5px; border-radius: 10px;
  background: rgba(255,255,255,0.7); border: 1px solid rgba(99,102,241,0.08);
  cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 4px rgba(79,70,229,0.03);
}
.recent-task-item:hover { background: rgba(79,70,229,0.04); border-color: rgba(79,70,229,0.16); transform: translateX(2px); }
.recent-task-item .task-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.recent-task-item .task-dot.dot-completed { background: var(--step-completed); }
.recent-task-item .task-dot.dot-failed { background: var(--step-failed); }
.recent-task-item .task-dot.dot-partial { background: var(--step-partial); }
.recent-task-item .task-dot.dot-interrupted { background: var(--step-interrupted); }
.recent-task-item .task-dot.dot-running { background: var(--step-running); }
.recent-task-item .task-info { flex: 1; min-width: 0; }
.recent-task-item .task-info-id { font-size: 0.7rem; font-weight: 500; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-task-item .task-info-meta { font-size: 0.64rem; color: #64748B; }

/* ═══════════ CENTER: AGENT RUN CANVAS ═══════════ */

/* Run Summary Bar */
.run-summary-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; margin-bottom: 14px;
  background: rgba(255,255,255,0.7); backdrop-filter: blur(12px);
  border: 1px solid rgba(99,102,241,0.10); border-radius: 14px;
  box-shadow: 0 2px 8px rgba(79,70,229,0.04);
  font-size: 0.74rem; color: #475569;
  min-height: 42px; /* fixed height prevents jank */
  flex-shrink: 0;
}
.run-summary-bar .run-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
}
.run-summary-bar .run-status-dot.dot-completed { background: linear-gradient(135deg, #059669, #14B8A6); }
.run-summary-bar .run-status-dot.dot-failed { background: linear-gradient(135deg, #DC2626, #F43F5E); }
.run-summary-bar .run-status-dot.dot-partial { background: linear-gradient(135deg, #D97706, #F59E0B); }
.run-summary-bar .run-status-dot.dot-interrupted { background: #64748B; }
.run-summary-bar .run-status-dot.dot-running { animation: dotPulse 1.5s ease-in-out infinite; }
.run-summary-bar .run-info { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-summary-bar .run-info strong { color: #1e293b; font-weight: 600; }
.run-summary-bar .run-progress-text {
  font-variant-numeric: tabular-nums; font-weight: 600; color: #4F46E5; min-width: 36px; text-align: right;
}
.run-summary-bar .run-elapsed {
  font-variant-numeric: tabular-nums; color: #64748B; min-width: 48px; text-align: right;
}

/* Current Step Card */
.current-step-card {
  min-height: 180px; padding: 24px 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(239,246,255,0.68));
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(99,102,241,0.14);
  box-shadow: 0 20px 60px rgba(79,70,229,0.10);
  margin-bottom: 14px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.5s;
}
.current-step-card.is-running {
  border-color: rgba(79,70,229,0.22);
  animation: borderGlow 3s ease-in-out infinite;
}
.current-step-card.is-completed { border-color: rgba(20,184,166,0.22); }
.current-step-card.is-partial { border-color: rgba(245,158,11,0.22); }
.current-step-card.is-failed { border-color: rgba(244,63,94,0.18); }

.current-step-card .cs-icon {
  font-size: 1.8rem; margin-bottom: 10px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED, #06B6D4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.current-step-card.is-running .cs-icon { animation: iconPulse 2s ease-in-out infinite; }
.current-step-card.is-completed .cs-icon {
  background: linear-gradient(135deg, #059669, #14B8A6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.current-step-card .cs-name {
  font-size: 1.1rem; font-weight: 700; color: #1e293b; margin-bottom: 6px;
}
.current-step-card .cs-message {
  font-size: 0.82rem; color: #475569; line-height: 1.5;
  max-height: 2.4em; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.3s;
}
.current-step-card .cs-meta {
  display: flex; gap: 16px; margin-top: 12px; font-size: 0.74rem; color: #64748B;
  font-variant-numeric: tabular-nums;
}
.current-step-card .cs-progress-bar {
  margin-top: 14px; height: 4px; border-radius: 2px;
  background: rgba(99,102,241,0.12); overflow: hidden;
}
.current-step-card .cs-progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #4F46E5, #7C3AED, #06B6D4);
  background-size: 200% 100%;
  transition: width 0.6s ease;
}
.current-step-card.is-running .cs-progress-fill { animation: progressFlow 2s linear infinite; }

/* Empty current step card */
.current-step-card.is-empty {
  align-items: center; text-align: center; min-height: 160px;
  border: 1.5px dashed rgba(99,102,241,0.16);
  background: rgba(248,251,255,0.6);
  box-shadow: none;
}
.current-step-card.is-empty .cs-icon { opacity: 0.4; animation: breathe 3s ease-in-out infinite; }
.current-step-card.is-empty .cs-name { color: #94A3B8; font-weight: 600; font-size: 0.9rem; }

/* Timeline Shell — fixed-height step cards */
.timeline-shell {
  flex: 1; overflow-y: auto; min-height: 0;
  padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.18) transparent;
}
.timeline-shell::-webkit-scrollbar { width: 5px; }
.timeline-shell::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.18); border-radius: 999px; }

.agent-step-card {
  height: 68px; min-height: 68px;
  display: grid; grid-template-columns: 32px 1fr 80px;
  align-items: center; gap: 10px;
  padding: 0 14px; margin-bottom: 6px;
  border-radius: 12px; border: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s;
}
.agent-step-card .step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--step-pending); transition: background 0.3s, box-shadow 0.3s;
  justify-self: center;
}
.agent-step-card .step-content { min-width: 0; }
.agent-step-card .step-name {
  font-size: 0.78rem; font-weight: 600; color: #94A3B8;
  transition: color 0.25s;
}
.agent-step-card .step-message {
  font-size: 0.7rem; color: #94A3B8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; transition: color 0.25s, opacity 0.3s;
}
.agent-step-card .step-status-chip {
  min-width: 72px; text-align: center;
  font-size: 0.66rem; font-weight: 600; padding: 3px 8px;
  border-radius: 8px; text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
  background: rgba(148,163,184,0.10); color: #94A3B8;
}

/* Step states */
.agent-step-card.s-running {
  background: rgba(79,70,229,0.06); border-color: rgba(79,70,229,0.14);
}
.agent-step-card.s-running .step-dot { background: #4F46E5; box-shadow: 0 0 0 3px rgba(79,70,229,0.2); animation: dotPulse 1.5s ease-in-out infinite; }
.agent-step-card.s-running .step-name { color: #4F46E5; }
.agent-step-card.s-running .step-message { color: #6366F1; }
.agent-step-card.s-running .step-status-chip { background: rgba(79,70,229,0.10); color: #4F46E5; }

.agent-step-card.s-completed { background: rgba(20,184,166,0.05); }
.agent-step-card.s-completed .step-dot { background: #0F766E; }
.agent-step-card.s-completed .step-name { color: #0F766E; }
.agent-step-card.s-completed .step-message { color: #14B8A6; }
.agent-step-card.s-completed .step-status-chip { background: rgba(20,184,166,0.10); color: #0F766E; }

.agent-step-card.s-partial { background: rgba(245,158,11,0.05); }
.agent-step-card.s-partial .step-dot { background: #B45309; }
.agent-step-card.s-partial .step-name { color: #B45309; }
.agent-step-card.s-partial .step-message { color: #D97706; }
.agent-step-card.s-partial .step-status-chip { background: rgba(245,158,11,0.10); color: #B45309; }

.agent-step-card.s-failed { background: rgba(244,63,94,0.04); }
.agent-step-card.s-failed .step-dot { background: #BE123C; }
.agent-step-card.s-failed .step-name { color: #BE123C; }
.agent-step-card.s-failed .step-message { color: #E11D48; }
.agent-step-card.s-failed .step-status-chip { background: rgba(244,63,94,0.10); color: #BE123C; }

.agent-step-card.s-interrupted { background: rgba(100,116,139,0.05); }
.agent-step-card.s-interrupted .step-dot { background: #475569; }
.agent-step-card.s-interrupted .step-name { color: #475569; }
.agent-step-card.s-interrupted .step-status-chip { background: rgba(100,116,139,0.10); color: #475569; }

.agent-step-card.s-skipped { opacity: 0.5; }
.agent-step-card.s-skipped .step-dot { background: #CBD5E1; }

/* Log Stream Panel */
.log-stream-panel {
  height: 160px; min-height: 160px; max-height: 160px;
  overflow-y: auto; margin-top: 10px; padding: 12px 14px;
  background: rgba(239,246,255,0.55); border-radius: 16px;
  border: 1px solid rgba(99,102,241,0.10);
  scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.15) transparent;
  flex-shrink: 0;
}
.log-stream-panel::-webkit-scrollbar { width: 4px; }
.log-stream-panel::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.15); border-radius: 999px; }
.log-stream-panel .log-line {
  font-size: 0.72rem; line-height: 1.7; color: #475569;
  animation: fadeIn 0.3s ease;
}
.log-stream-panel .log-time {
  color: #64748B; font-variant-numeric: tabular-nums; margin-right: 6px; font-size: 0.68rem;
}
.log-stream-panel .log-empty { color: #94A3B8; font-size: 0.76rem; text-align: center; padding: 30px 0; }

/* ═══════════ RIGHT: RESULT EVIDENCE PANEL ═══════════ */
.result-evidence-panel { min-width: 0; overflow: hidden; }
#resultDefault,
#resultSections {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.18) transparent;
}
#resultDefault::-webkit-scrollbar,
#resultSections::-webkit-scrollbar { width: 5px; }
#resultDefault::-webkit-scrollbar-thumb,
#resultSections::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.18); border-radius: 999px; }
.result-panel-section { margin-bottom: 14px; min-width: 0; overflow-wrap: anywhere; }
.result-panel-section-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: linear-gradient(135deg, #1e40af, #6366F1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
}
.result-status-card {
  padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,0.8); border: 1px solid rgba(99,102,241,0.08);
  box-shadow: 0 2px 8px rgba(79,70,229,0.03); margin-bottom: 10px;
}
.result-status-card .status-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.result-status-card .status-label { font-size: 0.72rem; color: #64748B; }
.result-status-card .status-value { font-size: 0.76rem; font-weight: 600; color: #334155; text-align: right; overflow-wrap: anywhere; min-width: 0; }

/* Artifact placeholders */
.artifact-stack { display: flex; flex-direction: column; gap: 6px; }
.artifact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.7); border: 1px solid rgba(99,102,241,0.08);
  transition: all 0.3s;
}
.artifact-item.is-pending { opacity: 0.45; }
.artifact-item.is-ready { opacity: 1; border-color: rgba(20,184,166,0.18); background: rgba(240,253,250,0.6); }
.artifact-item.is-partial { opacity: 0.8; border-color: rgba(245,158,11,0.16); }
.artifact-item.is-failed { opacity: 0.7; border-color: rgba(244,63,94,0.14); }
.artifact-item .artifact-icon {
  width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; background: rgba(99,102,241,0.08); color: #6366F1;
  transition: background 0.3s, color 0.3s;
}
.artifact-item.is-ready .artifact-icon { background: rgba(20,184,166,0.12); color: #0F766E; }
.artifact-item .artifact-label { flex: 1; font-size: 0.74rem; color: #475569; font-weight: 500; }
.artifact-item .artifact-action {
  font-size: 0.68rem; padding: 3px 8px; border-radius: 6px;
  background: rgba(79,70,229,0.08); color: #4F46E5; border: none; cursor: pointer;
  font-weight: 500; opacity: 0; transition: opacity 0.2s;
}
.artifact-item.is-ready .artifact-action { opacity: 1; }
.artifact-item.is-ready .artifact-action:hover { background: rgba(79,70,229,0.14); }
.report-download-card {
  align-items: center;
  border-color: rgba(37,99,235,0.14) !important;
  background: linear-gradient(135deg, rgba(239,246,255,0.9), rgba(255,255,255,0.82)) !important;
}
.report-download-card .artifact-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.report-download-card .artifact-label strong {
  color: #1E3A8A;
  font-size: 0.78rem;
}
.report-download-card .artifact-label span {
  color: #64748B;
  font-size: 0.68rem;
  line-height: 1.35;
}
.report-download-card .report-download-btn {
  opacity: 1;
  min-width: 58px;
  padding: 6px 11px;
  background: #2563EB;
  color: #fff;
}
.report-download-card .report-download-btn:hover { background: #1D4ED8; }
.report-download-card .report-download-btn:disabled {
  cursor: not-allowed;
  background: rgba(148,163,184,0.45);
}

/* Warnings / Errors */
.result-warnings, .result-errors {
  padding: 10px 12px; border-radius: 10px; font-size: 0.74rem; line-height: 1.55; margin: 0 0 8px;
  width: 100%; max-width: 100%; box-sizing: border-box;
  overflow-wrap: anywhere; word-break: break-word; white-space: normal;
}
.result-warnings { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.16); color: #92400E; }
.result-errors { background: rgba(244,63,94,0.05); border: 1px solid rgba(244,63,94,0.14); color: #9F1239; }
.result-warnings li,
.result-errors li { margin: 0 0 5px 16px; padding-left: 2px; max-width: calc(100% - 18px); }

/* File list */
.file-list { list-style: none; padding: 0; margin: 0; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; margin-bottom: 5px; border-radius: 10px;
  background: rgba(255,255,255,0.75); border: 1px solid rgba(99,102,241,0.07);
  transition: all 0.2s;
}
.file-item:hover { background: rgba(79,70,229,0.04); border-color: rgba(79,70,229,0.14); }
.file-item-name { font-size: 0.74rem; color: #334155; font-weight: 500; }
.file-item-meta { font-size: 0.64rem; color: #94A3B8; }
.file-item .download-btn {
  font-size: 0.7rem; padding: 3px 9px; border-radius: 6px;
  background: rgba(79,70,229,0.08); color: #4F46E5; border: none; cursor: pointer; font-weight: 500;
}
.file-item .download-btn:hover { background: rgba(79,70,229,0.14); }

/* Empty state for result panel */
.result-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px; text-align: center;
}
.result-empty-state .empty-icon {
  font-size: 2rem; margin-bottom: 12px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  opacity: 0.35; animation: breathe 3s ease-in-out infinite;
}
.result-empty-state .empty-title { font-size: 0.84rem; color: #64748B; font-weight: 600; margin-bottom: 6px; }
.result-empty-state .empty-desc { font-size: 0.74rem; color: #94A3B8; line-height: 1.5; }

/* ═══════════ EVIDENCE CHIPS ═══════════ */
.evidence-source-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(99,102,241,0.08);
}
.evidence-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 14px;
  background: rgba(148,163,184,0.10); color: #94A3B8;
  border: 1px solid rgba(148,163,184,0.15);
  transition: all 0.3s; white-space: nowrap;
  text-decoration: none;
}
.evidence-chip .ec-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
}
.evidence-chip.ec-dimmed { opacity: 0.45; color: #94A3B8; }
.evidence-chip.ec-searching {
  opacity: 1;
  color: #6D28D9; background: rgba(109,40,217,0.08);
  border-color: rgba(109,40,217,0.20);
  animation: chipPulse 1.8s ease-in-out infinite;
}
.evidence-chip.ec-visited {
  opacity: 1;
  color: #0F766E; background: rgba(20,184,166,0.08);
  border-color: rgba(20,184,166,0.20);
}
.evidence-chip.ec-ready {
  opacity: 1;
  color: #065F46; background: rgba(16,185,129,0.10);
  border-color: rgba(16,185,129,0.22);
}
.evidence-chip.ec-clickable {
  cursor: pointer;
}
.evidence-chip.ec-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79,70,229,0.12);
}

/* Evidence row inside current step card */
.cs-evidence-row {
  height: 38px; min-height: 38px; max-height: 38px;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  white-space: nowrap; margin-top: 10px;
  scrollbar-width: none;
}
.cs-evidence-row::-webkit-scrollbar { display: none; }

/* Right panel default sections */
.evidence-default-section { margin-bottom: 14px; }
.evidence-default-section .section-label {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: linear-gradient(135deg, #1e40af, #6366F1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
}
.evidence-default-section .section-hint {
  font-size: 0.72rem; color: #94A3B8; line-height: 1.5;
}

/* ═══════════ EMPTY STATES ═══════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 16px; text-align: center;
}
.empty-state-icon {
  font-size: 2rem; margin-bottom: 12px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  opacity: 0.4; animation: breathe 3s ease-in-out infinite;
}
.empty-state-text { font-size: 0.82rem; color: #64748B; line-height: 1.5; }
.empty-pipeline {
  display: flex; align-items: center; gap: 5px; padding: 16px 0; justify-content: center; flex-wrap: wrap;
}
.empty-pipeline .pipe-node {
  font-size: 0.68rem; padding: 5px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.75); border: 1px solid rgba(99,102,241,0.10);
  color: #64748B; animation: breathe 3s ease-in-out infinite;
}
.empty-pipeline .pipe-node:nth-child(2) { animation-delay: 0.25s; }
.empty-pipeline .pipe-node:nth-child(3) { animation-delay: 0.5s; }
.empty-pipeline .pipe-node:nth-child(4) { animation-delay: 0.75s; }
.empty-pipeline .pipe-node:nth-child(5) { animation-delay: 1.0s; }
.empty-pipeline .pipe-node:nth-child(6) { animation-delay: 1.25s; }
.empty-pipeline .pipe-arrow { color: rgba(99,102,241,0.3); font-size: 0.66rem; }

.skeleton { background: linear-gradient(90deg, rgba(238,246,255,0.8) 25%, rgba(255,255,255,0.5) 50%, rgba(238,246,255,0.8) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: 6px; }
.skeleton-line { height: 10px; margin-bottom: 7px; }
.skeleton-line.w75 { width: 75%; }
.skeleton-line.w50 { width: 50%; }

/* ═══════════ FLOATING ASSISTANT (FAB) ═══════════ */
.swiftagent-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
}
.fab-bubble {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #fff;
  font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(79,70,229,0.35); transition: all 0.3s;
}
.fab-bubble:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(79,70,229,0.45); }
.fab-bubble:active { transform: scale(0.95); }
.fab-panel {
  position: absolute; bottom: 64px; right: 0; width: 280px;
  padding: 18px; border-radius: 18px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(99,102,241,0.12);
  box-shadow: 0 20px 60px rgba(79,70,229,0.15);
  opacity: 0; transform: translateY(10px) scale(0.95); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.fab-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fab-panel-title {
  font-size: 0.8rem; font-weight: 700;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
}
.fab-panel-hint { font-size: 0.74rem; color: #64748B; line-height: 1.5; margin-bottom: 10px; }
.fab-panel-input {
  width: 100%; padding: 9px 12px; font-size: 0.78rem;
  border: 1.5px solid rgba(99,102,241,0.14); border-radius: 10px;
  background: rgba(248,251,255,0.9); color: #334155; margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fab-panel-input:focus {
  outline: none; border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.fab-panel-cta {
  display: block; text-align: center; font-size: 0.74rem; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; text-decoration: none;
  background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #fff;
  box-shadow: 0 3px 12px rgba(79,70,229,0.2); transition: box-shadow 0.2s;
}
.fab-panel-cta:hover { box-shadow: 0 5px 18px rgba(79,70,229,0.3); }

/* ═══════════ KEYFRAME ANIMATIONS ═══════════ */
@keyframes ribbonBreathe {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.22; }
}
@keyframes ghostFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes bubbleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  33% { transform: translate(3px, -4px) scale(1.04); opacity: 1; }
  66% { transform: translate(-2px, 2px) scale(0.97); opacity: 0.85; }
}
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(109,40,217,0.2); }
  50% { box-shadow: 0 0 0 4px rgba(109,40,217,0.08); }
}
@keyframes borderGlow {
  0%, 100% { box-shadow: 0 20px 60px rgba(79,70,229,0.10); }
  50% { box-shadow: 0 20px 60px rgba(79,70,229,0.18), 0 0 0 1px rgba(79,70,229,0.08); }
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}
@keyframes iconPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
@keyframes progressFlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════ EVIDENCE RESULT CARDS ═══════════ */
.evidence-result-card {
  padding: 16px 18px; margin-bottom: 12px; border-radius: 16px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(99,102,241,0.10);
  box-shadow: 0 4px 16px rgba(79,70,229,0.04);
  animation: fadeSlideIn 0.3s ease;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.evidence-result-card:hover {
  box-shadow: 0 6px 20px rgba(79,70,229,0.08);
  border-color: rgba(99,102,241,0.16);
}

/* Card header with title + badge */
.evidence-result-card .evidence-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(99,102,241,0.06);
}
.evidence-result-card .evidence-card-title {
  font-size: 0.74rem; font-weight: 700; color: #1e40af;
  display: flex; align-items: center; gap: 6px;
}
.evidence-result-card .evidence-card-body { font-size: 0.76rem; color: #334155; }

/* Source badges (links to OpenTargets, PubMed) */
.ev-source-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.64rem; font-weight: 600; padding: 3px 10px;
  border-radius: 12px; text-decoration: none;
  background: rgba(79,70,229,0.06); color: #4F46E5;
  border: 1px solid rgba(79,70,229,0.12);
  transition: all 0.2s;
}
.ev-source-badge:hover {
  background: rgba(79,70,229,0.12); color: #3730A3;
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(79,70,229,0.12);
}
.ev-count-badge {
  font-size: 0.64rem; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: rgba(20,184,166,0.08); color: #0F766E;
}

/* Gene overview */
.ev-gene-name {
  font-size: 0.88rem; font-weight: 700; color: #1e293b; margin-bottom: 4px;
}
.ev-func-desc {
  font-size: 0.74rem; color: #475569; line-height: 1.6;
}

/* Hint text */
.ev-hint { font-size: 0.72rem; color: #94A3B8; line-height: 1.5; }

/* Stat rows */
.ev-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
}
.ev-stat-label { font-size: 0.72rem; color: #64748B; }
.ev-stat-value { font-size: 0.76rem; font-weight: 600; color: #1e293b; }

/* Tractability badge */
.ev-tractability-badge {
  font-size: 0.62rem; font-weight: 700; padding: 2px 9px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em;
  background: rgba(148,163,184,0.12); color: #64748B;
}
.ev-tractability-badge[class*="clinical"] { background: rgba(16,185,129,0.10); color: #065F46; }

/* Drug list */
.ev-drug-list { margin-top: 8px; }
.ev-drug-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid rgba(99,102,241,0.04);
}
.ev-drug-item:last-child { border-bottom: none; }
.ev-drug-name { font-size: 0.72rem; font-weight: 500; color: #334155; flex: 1; }
.ev-drug-phase {
  font-size: 0.62rem; font-weight: 600; padding: 2px 7px;
  border-radius: 8px; background: rgba(79,70,229,0.06); color: #4F46E5;
}
.ev-drug-link {
  font-size: 0.62rem; color: #64748B; text-decoration: none;
  transition: color 0.2s;
}
.ev-drug-link:hover { color: #4F46E5; }

/* Disease list */
.ev-disease-list { margin-top: 6px; }
.ev-disease-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid rgba(99,102,241,0.04);
}
.ev-disease-item:last-child { border-bottom: none; }
.ev-disease-name { font-size: 0.72rem; color: #334155; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-score-bar {
  width: 48px; height: 4px; border-radius: 2px;
  background: rgba(99,102,241,0.10); overflow: hidden; flex-shrink: 0;
}
.ev-score-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #4F46E5, #06B6D4);
}
.ev-disease-link {
  font-size: 0.62rem; color: #64748B; text-decoration: none;
  transition: color 0.2s; flex-shrink: 0;
}
.ev-disease-link:hover { color: #4F46E5; }

/* Article list */
.ev-article-list { margin-top: 6px; }
.ev-article-item {
  display: block; padding: 8px 10px; margin-bottom: 6px;
  border-radius: 10px; text-decoration: none;
  background: rgba(248,251,255,0.8); border: 1px solid rgba(99,102,241,0.06);
  transition: all 0.2s;
}
.ev-article-item:hover {
  background: rgba(79,70,229,0.04); border-color: rgba(79,70,229,0.14);
  transform: translateX(2px);
}
.ev-article-title {
  font-size: 0.72rem; font-weight: 500; color: #1e293b;
  line-height: 1.4; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ev-article-meta { font-size: 0.64rem; color: #64748B; }

/* Evidence report content area */
.evidence-report-content {
  margin-top: 14px; padding: 0;
  max-height: min(68vh, 720px); width: 100%; max-width: 100%; overflow: auto;
  box-sizing: border-box;
  border-radius: 16px;
  background: rgba(248,251,255,0.92); border: 1px solid rgba(99,102,241,0.08);
  scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.18) transparent;
}
.evidence-report-content::-webkit-scrollbar { width: 5px; }
.evidence-report-content::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.18); border-radius: 999px; }

.ev-report-header {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 16px; font-size: 0.68rem; font-weight: 700;
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(139,92,246,0.04));
  border-bottom: 1px solid rgba(99,102,241,0.08);
  color: #4F46E5; display: flex; align-items: center; gap: 6px;
  border-radius: 16px 16px 0 0;
}

.evidence-report-content .evidence-report-text {
  padding: 14px 16px;
  font-size: 0.76rem; line-height: 1.8; color: #334155;
  min-width: 0; max-width: 100%; box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word; white-space: normal;
}
.evidence-report-text p { margin: 0 0 10px; }
.evidence-report-text a { overflow-wrap: anywhere; word-break: break-word; }
.evidence-report-text .ev-rpt-h1 { font-size: 0.92rem; font-weight: 700; color: #1e293b; margin: 16px 0 8px; }
.evidence-report-text .ev-rpt-h2 { font-size: 0.84rem; font-weight: 700; color: #1e40af; margin: 14px 0 6px; }
.evidence-report-text .ev-rpt-h3 { font-size: 0.78rem; font-weight: 600; color: #334155; margin: 10px 0 4px; }
.evidence-report-text .ev-rpt-h4 { font-size: 0.76rem; font-weight: 600; color: #475569; margin: 8px 0 4px; }
.evidence-report-text strong { color: #1e293b; }
.evidence-report-text em { color: #475569; font-style: italic; }
.evidence-report-text li { margin-left: 16px; margin-bottom: 3px; list-style: disc; }
.evidence-report-text li.ev-sub-li { margin-left: 32px; list-style: circle; font-size: 0.72rem; }
.evidence-report-text .ev-rpt-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  border-collapse: collapse;
  margin: 8px 0 12px;
}
.evidence-report-text tr { display: table-row; }
.evidence-report-text td { padding: 4px 8px; border: 1px solid rgba(99,102,241,0.10); font-size: 0.72rem; vertical-align: top; overflow-wrap: anywhere; }
.evidence-report-text .ev-rpt-hr { border: none; border-top: 1px solid rgba(99,102,241,0.10); margin: 12px 0; }

.pipeline-evidence-trail {
  margin: 10px 0 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(37,99,235,0.10);
}
.pipeline-evidence-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.74rem; font-weight: 700; color: #1E40AF;
  margin-bottom: 9px;
}
.pipeline-evidence-list { display: flex; flex-direction: column; gap: 7px; }
.pipeline-evidence-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(248,251,255,0.78);
  border: 1px solid rgba(99,102,241,0.08);
}
.pipeline-evidence-item.pei-ready { border-color: rgba(16,185,129,0.16); }
.pipeline-evidence-item.pei-partial { border-color: rgba(245,158,11,0.16); }
.pei-source {
  align-self: start;
  justify-self: start;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #1D4ED8;
  background: rgba(37,99,235,0.08);
  overflow-wrap: anywhere;
}
.pei-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pei-body strong { font-size: 0.72rem; color: #0F172A; overflow-wrap: anywhere; }
.pei-body span { font-size: 0.68rem; line-height: 1.45; color: #64748B; overflow-wrap: anywhere; }

/* Inline reference links in report */
.ev-inline-ref {
  color: #4F46E5; text-decoration: none; font-weight: 500;
  padding: 0 2px; border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}
.ev-inline-ref:hover {
  background: rgba(79,70,229,0.08); color: #3730A3;
  text-decoration: underline;
}

/* SWITCH prompt area */
.switch-prompt {
  margin-top: 14px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(99,102,241,0.04));
  border: 1px solid rgba(139,92,246,0.14);
}
.switch-prompt .switch-prompt-text {
  font-size: 0.74rem; color: #5B21B6; line-height: 1.5; margin-bottom: 10px;
}
.switch-prompt .agent-btn { width: 100%; justify-content: center; }

/* Card accent borders */
.ev-card-gene { border-left: 3px solid #4F46E5; }
.ev-card-structure { border-left: 3px solid #06B6D4; }
.ev-card-drug { border-left: 3px solid #10B981; }
.ev-card-disease { border-left: 3px solid #F59E0B; }
.ev-card-lit { border-left: 3px solid #8B5CF6; }

/* ═══════════ PIPELINE RESULT: Molecule Grid & Metric Bars ═══════════ */

/* Step overview dots */
.pipeline-step-overview {
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
  padding: 8px 12px; border-radius: 10px; background: rgba(248,251,255,0.8);
  flex-wrap: wrap;
}
.step-dot-item {
  display: flex; align-items: center; gap: 3px;
  font-size: 0.62rem; color: #64748B;
}
.step-dot-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.step-dot-item .dot.dot-completed { background: #10B981; }
.step-dot-item .dot.dot-failed { background: #EF4444; }
.step-dot-item .dot.dot-skipped { background: #CBD5E1; }
.step-dot-item .dot.dot-partial { background: #F59E0B; }
.step-dot-item .dot.dot-not_run { background: #CBD5E1; }
.step-dot-item .dot.dot-running { background: #4F46E5; }

/* Molecule grid */
.mol-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px;
}
.mol-card {
  padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(99,102,241,0.08);
  transition: all 0.2s;
}
.mol-card:hover {
  border-color: rgba(99,102,241,0.18);
  box-shadow: 0 4px 12px rgba(79,70,229,0.06);
}
.mol-card-img { text-align: center; margin-bottom: 6px; }
.mol-card-img img {
  width: 100%; max-width: 140px; border-radius: 8px; background: #f8fbff;
}
.mol-card-rank {
  font-size: 0.64rem; font-weight: 700; color: #4F46E5; margin-bottom: 4px;
}

/* Metric bars */
.metric-row { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.metric-label { font-size: 0.6rem; color: #64748B; width: 32px; text-align: right; }
.metric-bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(99,102,241,0.08); overflow: hidden;
}
.metric-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }
.metric-fill.mc-good { background: linear-gradient(90deg, #10B981, #14B8A6); }
.metric-fill.mc-warn { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.metric-fill.mc-bad { background: linear-gradient(90deg, #EF4444, #F87171); }
.metric-fill.mc-neutral { background: linear-gradient(90deg, #6366F1, #8B5CF6); }
.metric-value { font-size: 0.6rem; font-weight: 600; color: #334155; width: 32px; }

/* Delivery card */
.delivery-card-body { font-size: 0.74rem; color: #334155; line-height: 1.6; }
.delivery-card-body .delivery-item {
  padding: 6px 0; border-bottom: 1px solid rgba(99,102,241,0.06);
}
.delivery-card-body .delivery-item:last-child { border-bottom: none; }
.delivery-details { margin-top: 8px; }
.delivery-details .delivery-item {
  padding: 8px 10px; margin-bottom: 4px;
  border-radius: 8px; background: rgba(6,182,212,0.04);
  border: 1px solid rgba(6,182,212,0.08);
  border-bottom: none;
}
.delivery-details .delivery-item div { font-size: 0.68rem; color: #475569; margin-top: 2px; }

/* ═══════════ TASK CONFIRMATION CARD ═══════════ */
.task-confirmation-card {
  background: #FFFFFF;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 0;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}

.task-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.task-type-badge.tc-full_pipeline {
  background: rgba(79, 70, 229, 0.10);
  color: #4F46E5;
}
.task-type-badge.tc-info_only {
  background: rgba(20, 184, 166, 0.10);
  color: #0F766E;
}
.task-type-badge.tc-needs_clarification {
  background: rgba(245, 158, 11, 0.10);
  color: #B45309;
}
.task-type-badge.tc-unknown {
  background: rgba(100, 116, 139, 0.10);
  color: #475569;
}

.task-summary {
  font-size: 0.85rem;
  color: #1E293B;
  line-height: 1.5;
  margin-bottom: 12px;
}

.task-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tc-entity {
  display: inline-block;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.74rem;
  color: #1E40AF;
  font-weight: 500;
}

.task-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 8px;
}
.pref-item {
  font-size: 0.74rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 5px;
}
.pref-icon {
  color: var(--agent-violet);
  font-size: 0.7rem;
  width: 14px;
  text-align: center;
}

.plan-steps-section {
  margin-bottom: 14px;
}
.plan-steps-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-steps-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: background 0.15s;
}
.plan-step-item:hover {
  background: rgba(241, 245, 249, 0.9);
}
.plan-step-item .step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--agent-blue);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.plan-step-item .step-name {
  flex: 1;
  font-size: 0.78rem;
  color: #1E293B;
  font-weight: 500;
}
.plan-step-item .step-duration {
  font-size: 0.68rem;
  color: #94A3B8;
  white-space: nowrap;
}

.task-clarification {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 8px;
}
.clarification-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #B45309;
  margin-bottom: 6px;
}
.clarification-item {
  font-size: 0.76rem;
  color: #92400E;
  padding: 2px 0;
}

.task-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
}
.task-actions .agent-btn {
  flex: 1;
}

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .agent-hero-visual * { animation: none !important; transition: none !important; }
  .current-step-card .cs-progress-fill { animation: none; }
  .agent-step-card.s-running .step-dot { animation: none; }
  .evidence-chip.ec-searching { animation: none; }
  .fab-panel { transition: none; }
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1280px) {
  .agent-workbench-grid { grid-template-columns: 300px 1fr 280px; gap: 14px; }
}
@media (max-width: 1024px) {
  .agent-workbench-grid { grid-template-columns: 1fr; gap: 16px; }
  .agent-panel { height: auto; min-height: auto; max-height: none; }
  .task-input-panel, .result-evidence-panel { overflow-y: visible; }
  .timeline-panel { max-height: 600px; }
  .agent-page { padding: 16px 16px 40px; }
  .agent-hero-visual { opacity: 0.5; }
  .bio-ribbon-bg { width: 360px; height: 180px; }
  .pipeline-orbit { display: none; }
}
@media (max-width: 640px) {
  .agent-hero-section { padding: 18px 16px; border-radius: 16px; min-height: 160px; }
  .agent-hero-section h1 { font-size: 1.2rem; }
  .agent-hero-visual { display: none; }
  .agent-panel { padding: 14px; border-radius: 16px; }
  .current-step-card { min-height: 140px; padding: 18px 20px; border-radius: 18px; }
  .agent-step-card { height: 60px; min-height: 60px; grid-template-columns: 24px 1fr 60px; }
  .swiftagent-fab { bottom: 16px; right: 16px; }
  .fab-panel { width: 260px; }
}
