/* ── Pipeline section ────────────────────────────────────────────────────── */
.pipeline-section {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.pipeline-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.pipeline-section h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.pipeline-steps {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* ── Agent step card ─────────────────────────────────────────────────────── */
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 14px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-page);
  min-width: 100px;
  flex: 1;
  max-width: 150px;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  position: relative;
  cursor: default;
}

/* ── Icon circle ─────────────────────────────────────────────────────────── */
.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #E5E7EB;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
  color: #C4C9D4;
}

.step-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

/* ── Step name ───────────────────────────────────────────────────────────── */
.step-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.01em;
  text-align: center;
  transition: color 0.2s;
  white-space: nowrap;
}

/* ── Step timing ─────────────────────────────────────────────────────────── */
.step-time {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.01em;
  min-height: 14px;
}

.step.done  .step-time  { color: #10B981; }
.step.error .step-time  { color: #EF4444; }
.step.active .step-time { color: #D97706; }

/* ── Status text via ::after ─────────────────────────────────────────────── */
.step::after {
  content: "대기";
  font-size: 10px;
  font-weight: 500;
  color: #D1D5DB;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

/* ── Active ──────────────────────────────────────────────────────────────── */
.step.active {
  border-color: #F59E0B;
  background: var(--gradient-card-amber);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.14), var(--shadow-amber);
}

.step.active .step-icon {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-color: #F59E0B;
  color: #fff;
  box-shadow: 0 0 10px rgba(245,158,11,0.45);
  animation: step-pulse 1.4s ease-in-out infinite;
}

.step.active .step-name { color: #92400E; }
.step.active::after     { content: "처리중"; color: #D97706; }

/* ── Done ────────────────────────────────────────────────────────────────── */
.step.done {
  border-color: #6EE7B7;
  background: var(--gradient-card-green);
  box-shadow: var(--shadow-green);
}

.step.done .step-icon {
  background: linear-gradient(135deg, #10B981, #059669);
  border-color: #10B981;
  color: #fff;
  box-shadow: 0 0 10px rgba(16,185,129,0.38);
}

.step.done .step-name { color: #065F46; }
.step.done::after     { content: "완료"; color: #10B981; }

/* ── Error ───────────────────────────────────────────────────────────────── */
.step.error {
  border-color: #FCA5A5;
  background: var(--gradient-card-red);
  box-shadow: var(--shadow-red);
}

.step.error .step-icon {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  border-color: #EF4444;
  color: #fff;
  box-shadow: 0 0 10px rgba(239,68,68,0.38);
}

.step.error .step-name { color: #991B1B; }
.step.error::after     { content: "실패"; color: #EF4444; }

/* ── Connector ──────────────────────────────────────────────────────────── */
.step-arrow {
  color: #D1D5DB;
  font-size: 18px;
  flex-shrink: 0;
  margin: 0 2px;
  align-self: center;
  padding-bottom: 24px;
  user-select: none;
}

/* ── Pulse animation ─────────────────────────────────────────────────────── */
@keyframes step-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(245,158,11,0.55); }
  65%  { box-shadow: 0 0 0 10px rgba(245,158,11,0);   }
  100% { box-shadow: 0 0 0 0   rgba(245,158,11,0);    }
}
